例如,我有一个 3 个不同的图像作为带有悬停的精灵。
<div class="sprite normal"></div>
我不要这种类型!
/* small */
.small{ width:20px; height:20px; }
.small .sprite{ background:url(sprite.png) 0 0 no-repeat; }
.small .sprite:hover { background:url(sprite.png) 20px 0 no-repeat; }
/* normal*/
.normal{ width:50px; height:50px; }
.normal .sprite{ background:url(sprite.png) 0 0 no-repeat; }
.normal .sprite:hover { background:url(sprite.png) 50px 0 no-repeat; }
/* big */
.big{ width:100px; height:100px; }
.big .sprite{ background:url(sprite.png) 0 0 no-repeat; }
.big .sprite:hover { background:url(sprite.png) 100px 0 no-repeat; }
有没有捷径?谢谢你..