Vik*_*Rao 2 html css php css-sprites
嗨,我正在使用图像精灵来显示各种图标.
XHTML
<div class="ListIcons">
<ul>
<li class="Icon i-scissors">A list item using the <strong>i-scissors</strong> class.</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.Icon {background:url(../images/icons/icons.png) no-repeat top left;}
.i-scissors{ background-position: 0 -52px; width: 32px; height: 32px; }
Run Code Online (Sandbox Code Playgroud)
问题

我的问题
如何隐藏正在显示的其他两个图像以及我想要的图像.
请帮忙!
雪碧
我正在使用的Sprite Image是这样的:

我稍微修改了一下代码
HTML
<div class="ListIcons">
<ul>
<li class="i-scissors">A list item using the <strong>i-scissors</strong> class.</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
li.i-scissors {
list-style: none outside none;
}
li.i-scissors:before {
background: url(../images/icons/icons.png) no-repeat scroll 0 -52px transparent;
content: " ";
display: block;
position: absolute;
width: 23px;
height: 32px;
top: 11px;
left: 19px;
}
Run Code Online (Sandbox Code Playgroud)
输出看起来像

您可以根据需要对css进行更改.