我想创建一个包含几张用作背景的图像的精灵。其中一些将与 norepeat 一起使用,而另一些将与 repeat-x 一起使用。
设置此类样式的最佳方法是什么?
到目前为止,我已经尝试过了,但它不能正常工作:
css
.sprites {
    background-color: transparent;
    background-image: url(img/sprites.png);
        background-repeat: no-repeat;
}
.bg {
    width: 1px;
    height: 25px;
    background-position: 0 0;
    background-repeat: repeat-x;
}
html
<div class="sprites bg">
</div>
这甚至可能吗?