简体   繁体   English

当鼠标经过时如何突出显示图像?

[英]How can i highlight an image when the mouse passes over it?

I would like highlight an image when button passed over, and then when i clicked over it, the site show me a sort of pop up.我想在按钮经过时突出显示图像,然后当我单击它时,该站点会向我显示一种弹出窗口。 Like in this photo.就像这张照片。 I checked the code of the page but the result is different.我检查了页面的代码,但结果不同。 在此处输入图片说明

<div th:each="photo : ${photos}" class="col-md-6 col-lg-4">
    <div class="portfolio-item mx-auto" data-toggle="modal" data-target="#portfolioModal1">
    <div class="portfolio-item-caption d-flex align-items-center justify-content-center h-100 w-100">
        <div class="portfolio-item-caption-content text-center text-white">
            <i class="fas fa-plus fa-3x"></i>
        </div>
    </div>
    <img class="img-fluid" th:src="${photo.path}" alt="IMage">

There is a W3schools tutorial on this explaining how to do it properly " https://www.w3schools.com/howto/howto_css_image_overlay.asp ".有一个 W3schools 教程解释了如何正确地做到这一点“ https://www.w3schools.com/howto/howto_css_image_overlay.asp ”。 For the pop-up I would suggest a modal using bootstrap.对于弹出窗口,我建议使用引导程序进行模态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM