【发布时间】:2011-10-27 12:51:43
【问题描述】:
我正在制作一个画廊,当您将鼠标悬停在主图像上时,缩略图应该变得透明。我想用纯 CSS 来实现这一点,但我不确定这是否可能。
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 吗?
【问题讨论】: