我有几个容器为每个容器指定了多个背景图片,并用逗号分隔,其中一个背景图片对于每个容器都是相同的。如何使用多个背景图像指定单个全局背景图像?
.foo_1 {
background-image: url(../img/01.png), url(../img/photo1.jpg);
}
.foo_2 {
background-image: url(../img/01.png), url(../img/photo2.jpg);
}
.foo_3 {
background-image: url(../img/01.png), url(../img/photo3.jpg);
}
.foo_1, .foo_2, .foo_3 {
background-position: top left, center center;
background-repeat: repeat, no-repeat;
background-size: auto, cover;
}
是否有任何方式为避免重复,在每个类中使用的图像,同时仍保持的背景图像的结构,并允许对于相同的操作作为一个正常的背景图片属性的?