我在图像上添加了悬停不透明效果,如下所示:
img {
opacity: 1.0;
filter: alpha(opacity=1.0);
}
img:hover {
opacity: 0.6;
filter: alpha(opacity=0.6);
}
我想对一张特定图像完全禁用此悬停效果。
如何实现这一目标?
最佳答案
为图像添加 ID,并将 CSS 更改为以下内容:
img{
opacity: 1.0;
filter: alpha(opacity=1.0);
}
img:not(#id):hover{
opacity: 0.6;
filter: alpha(opacity=0.6);
}
使用 :not()
选择器,您可以排除某些元素
关于css - 禁用一张特定图像的悬停不透明效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34746401/