我正在尝试在悬停时向父级添加内部边框,使图像保持不变并被裁剪为与父级边框相同的像素。
有什么想法吗?
HTML
<ul class="videoList">
<li>
<a href="#"><img src="http://www.flir.com/uploadedImages/Thermography_USA/Industries/ATS/Images/160x120-Uncooled-bolometer-E40-motorcycle.jpg" /></a>
</li>
<li>
<a href="#"><img src="http://www.flir.com/uploadedImages/Thermography_USA/Industries/ATS/Images/160x120-Uncooled-bolometer-E40-motorcycle.jpg" /></a>
</li>
</ul>
CSS
.videoList {padding:0;}
.videoList li {box-sizing:border-box;float:left;padding:0;display:block;}
.videoList li img {display: block;}
.videoList li:hover {border:solid 5px #eb6c34;}
小提琴:
http://jsfiddle.net/6Lon213n/1/
P.S。必须支持IE9 +。