简体   繁体   English

如何更改图像上的鼠标悬停

[英]How to change mouseover on images

I'm trying to code a website and every time I edit the images there's a mouseover effect and I want to have a plain image on the webpage.我正在尝试编写网站代码,每次编辑图像时都会出现鼠标悬停效果,我希望在网页上有一个纯图像。 The image is grayed out and when I mouseover it's not.图像变灰,当我将鼠标悬停时它不是。 How can I make it stay normal without having to mouseover?我怎样才能让它保持正常而不必鼠标悬停? When I click, it opens a link and just opens the same page.当我单击时,它会打开一个链接并打开同一页面。 SOS.求救。 <img src="images/image.jpg" alt="image" class="border2" />

If you have CSS stylesheets they may be causing the difference, use inspect element on it and see what styles are active and click on the :hov then the :hover button next to the filter bar in the styles tab to see how it changes. If you have CSS stylesheets they may be causing the difference, use inspect element on it and see what styles are active and click on the :hov hov then the :hover button next to the filter bar in the styles tab to see how it changes. Then look at the style side with hover activated and see where, if any, there are places with :hover in their selector.然后查看激活了 hover 的样式,看看在哪里,如果有的话,在他们的选择器中有:hover的地方。 Next find the place in your stylesheet where that selector is and copy its contents into the selector without :hover接下来在样式表中找到该选择器所在的位置,并将其内容复制到选择器中,而不使用:hover

Example例子

<button class="btn">Press Me</button>

which would then be styled by both:然后将由两者设置样式:

.btn {
    background-color: white;
}

.btn:hover {
    background-color: blue;
}

this would mean that when not hovered the button is white but then becomes blue when you hover over it.这意味着当没有悬停时,按钮是白色的,但是当你将 hover 放在它上面时,它会变成蓝色。 A similar thing may be happening to your image with something along the lines of:您的图像可能会发生类似的事情,类似于:

.border2 {
    background:#ffffff;
    opacity: 0.5;
}

.border2:hover {
    opacity: 1;
}

found this on Grey out all images other than active hover image灰色上发现除了活动 hover 图像以外的所有图像

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

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