DIV+CSS教程_解决关于CSS Sprites
码:a { background:url(ooxx.png) 999px 999px no-repeat; }
a.a { background-color:#ccc; background-position:0 -100px; }
a.b { background-position:0 -200px; }
a.c { background:#f5f5f5 url(ooxx.png) 0 -300px repeat-x; }
现在问题来了,是保持a.c使用复合属性,还是拆开来,写成:
代码:a.c {
background-color:#f5f5f5;
background-position:0 -300px;
background-repeat:repeat-x;
}
解决
a { background:url(ooxx.png) 999px 999px no-repeat; }
a.a { background-color:#ccc; background-position:0 -100px; }
a.b { background-position:0 -200px; }
a.c { background:#f5f5f5 url(ooxx.png) 0 -300px repeat-x; }
a.c {
background-color:#f5f5f5;
background-position:0 -300px;
background-repeat:repeat-x;
}