不,它并没有从速记声明中完全丢失。您仍然可以指定背景颜色,但只能指定最后一层(中间)(无论是否在其中放置图像):
div.arrow {
background: url('arrowtail.png') left no-repeat,
url('arrowhead.png') right no-repeat,
red;
}
请注意,对于您的方案,您的图像可能必须具有完全不透明的背景。背景颜色将显示在图像的任何透明像素下。
background- color
但是,单独声明可能会更好,因为它可以让您基于相同的背景图像使用不同的颜色(如果可以用CSS背景颜色填充图像部分的透明像素,则可以这样做):
div.arrow {
background: url('arrowtail.png') left no-repeat,
url('arrowhead.png') right no-repeat;
}
/* Assuming your red arrow has this ID */
#red {
background-color: red;
}