【发布时间】:2017-04-11 02:19:57
【问题描述】:
我在网上搜索了一下,发现这个:How to display image over image on hover with css。
我使用 Chrome 和 Firefox 在 jsfiddle 和博客文章中尝试了 this image 的代码。
他们都没有显示像this image这样的结果。
我的代码中有什么不正确的地方?谢谢。
a {
position: relative;
display: inline-block;
}
a:hover:before {
content: '';
display: block;
background-image:url('http://i.imgur.com/fGAbTOj.png');
width: 50px;
height: 50px;
position: absolute;
top: 0;
left: 0;
}
<a href="#"><img src="http://cdn.akamai.steamstatic.com/steam/apps/271590/ss_80b965d66b13d6eb5e1468151a371e12fe159663.600x338.jpg" /></a>
【问题讨论】:
标签: html css image hover display