E.g. J'ai une image différente de 3 en tant que sprite avec le vol stationnaire.CSS Sprite - existe-t-il un moyen possible?
<div class="sprite normal"></div>
je ne veux pas que ce 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; }
Y a-t-il un moyen? merci ..
Cela semble assez court et organisé pour moi. J'aimerais voir si quelqu'un a des suggestions sur la façon de le raccourcir. +1 – mavrosxristoforos
Je peux faire ça avec jquery mais je me demande, est-ce qu'il y a des css .. – avalkab
Oui, c'est une bonne question, mais je pense que c'est assez organisé, si vous appliquez aussi le changement qu'Amit Ranjan a posté comme réponse. – mavrosxristoforos