2
嗨,我正在使用圖像精靈顯示各種圖標。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>
的CSS
.Icon {background:url(../images/icons/icons.png) no-repeat top left;}
.i-scissors{ background-position: 0 -52px; width: 32px; height: 32px; }
問題
我的問題
如何隱藏正在顯示的其他兩個圖像以及我想要的圖像。
請幫助!
精靈
精靈形象,我現在用的就是這樣的:
或者,':before'僞元素在這裏可能會很有用,並會保持源代碼更清晰。 (IE不可用於7,IIRC) – 2012-03-19 08:14:40