假定它们是两个不同的属性,在您的特定示例中,结果没有差异,因为
background实际上是
背景色
背景图像
背景位置
背景重复
背景附件
背景剪辑
背景起源
背景大小
因此,除了之外
background-color,
background您还可以使用快捷方式添加一个或多个值,而无需重复任何其他
background-*属性。
选择哪种方法基本上取决于您,但是它也可能取决于样式声明的特定条件(例如,从父元素
background-color继承其他相关
background-*属性时是否需要覆盖the ,或者是否需要删除所有值)除外
background-color)。



