我想在图像上添加一个图标。我正在尝试关注,但它似乎不起作用:
HTML:
<ul>
<li>
<div class="icon">
<img src="image.jpg" />
</div>
</li>
</ul>
CSS:
ul{
margin: 0;
list-style: none;
position: relative;
}
.icon{
background : url("icon_quick.gif") no-repeat;
border: 1px solid red;
z-index: 2;
overflow: hidden;
}
演示:http: //jsfiddle.net/tqw4V/