例如,我有三个不同的图像作为精灵,带有悬停效果。
<div class="sprite normal"></div>
i dont want this type!
/* 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; }
有没有简便的方法?谢谢。