我正在做一个画廊,当你将鼠标悬停在主图像上时,缩略图应该变得透明。我想用纯CSS实现这一点,但我不确定这是否可能。影响div:悬停与另一个div
CSS:
/* should affect thumbs but not main */
/* obviously this code wouldn't work */
#main:hover, #thumbs {
opacity: .5;
}
HTML:
<div id="main">
Hover over me to change #thumbs
</div>
<div id="thumbs">
I change when you hover over #main
</div>
这可能使用纯CSS?
+1惊人......甚至不知道这个存在! http://meyerweb.com/eric/articles/webrev/200007a.html – samccone
哇!谢谢!这绝对是完美的!就像上面的那个人一样,我不知道这个存在。完善。 – JacobTheDev
+1我不知道你可以做到这一点没有Javascript。 –