我刚刚在答案中看到了这段代码:
<div class="thumbnail"> <img src="http://placehold.it/50x50"> <img class="overthumb" src="http://placehold.it/200x200"> </div>
CSS
.overthumb { display: none; } .thumbnail:hover .overthumb { position: absolute; top: 15px; left: 15px; display: inline; }
现场演示:http://jsfiddle.net/6wQp3/
要使此代码有效,.overthumb必须是.thumbnail的子代.
但如果有人有这个代码:
<div class="thumbnail"> <img src="http://placehold.it/50x50"> </div> <p>tttttttttt</p>
如果.thumbnail悬停,你会如何选择p标签?