background 背景
1、背景颜色
background-color: red;
2、背景图片
background-image: url(img/1.jpg);
3、背景重复
background-repeat: no-repeat;/*不重复*/
background-repeat: repeat;/*重复*/
background-repeat: repeat-x;/*X轴重复*/
background-repeat: repeat-y;/*Y轴重复*/
4、背景定位:可以用像素和英文
background-position: 10px 10px;
background-position: center top;
5、背景是否滚动
background-attachment: fixed; /*相对可视区固定位置*/
background-attachment: scroll; /*随滚轮滚动*/
6、复合样式:没有顺序之分,编写习惯如下
background: red url(img/1.jpg) no-repeat center top fixed;