◆ 背景属性:
★ background-color:背景颜色
background-color: grey;
★ background-image:背景图片
background-image:url("1.jpg");
★ background-repeat:背景平铺
repeat(默认) | no-repeat | repeat-x | repeat-y
background-repeat: no-repeat;
★ background-position:背景定位
left | right | center | top | bottom
★ Background-attachment:背景是否滚动
scroll | fixed
◆ background-position:
1、方位值只写一个的时候,另外一个值默认居中。
backgroud-position: right;
2、写2个方位值的时候,顺序没有要求。
background-position: right bottom;
3、写2个具体值的时候,第一个值代表水平方向,第二个值代表垂直方向。
background-position: 20px 30px;
◆ 背景属性连写:
连写的时候没有顺序要求,url为必写项。
background: red url("1.jpg") no-repeat 30px 40px scroll;