background复合属性顺序
使用顺序:
background 是背景缩写属性,可以在一个声明中设置所有的背景属性。
完整的写法:background:bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment;
background: #eee url(bg.png) center/cover no-repeat border-box content-box fixed;
默认值:
background: transparent none repeat scroll 0% 0%;
默认值(释义)
background: 透明 / 无背景图片 / 平铺 / 背景图片随文本滚动(不理解的一定要自己动手试一下) / 位于元素左上角
background复合属性依次为:
background-color:指定背景颜色,默认为透明。
background-image:指定背景图像的URL。
background-repeat:指定背景图像的重复方式,可选的值有repeat(默认)、repeat-x、repeat-y和no-repeat。
background-attachment:指定背景图像的滚动方式,可选的值有scroll(默认)和fixed。
background-position:指定背景图像的位置,默认为左上角,
可选的值有left、center、right、top、bottom等。