如何通过将鼠标悬停在另一个div中的图像(" pic1")上,将div图像(picturemain.png)更改为其他图像(例如" pic1") ? 纯css首选。
<div class="allSetupOne">
<div class="mainIMG">
<img id="main1" src="picturemain.png">
</div>
<div class="otherAngles">
<img id="pic1" src="pictures/gtemp1.png">
<img id="pic2" src="pictures/gtemp2.png">
<img id="pic3" src="pictures/gtemp3.png">
</div>
</div>
答案 0 :(得分:0)
See this answer
HTML 的
<div id="a">
<img src="im" />
<img class="first" src="im1" />
<img class="second" src="im2" />
</div>
CSS 的
#a img.second,
#a img.first:hover ~ img.second {
display: none;
}
#a img:hover ~ img.first {
display: none;
}
#a img:hover ~ img.second {
display: inline-block;
}