1. background-color:元素默认背景颜色默认值是transparent(透明的)
2. background-repeat:repeat、no-repeat、repeat-x、repeat-y
背景颜色在背景图片之下
3. background-position:背景图片在背景中的位置
background-position:x y / 方位名词 / 精确单位;
background-position:center top;(无顺序)
如果只指定了一个方位名词,另一个值省略,则这一个值默认居中对齐
background-position:right (center);
如果参数是精确单位,第一个肯定是x坐标,第二个肯定是y坐标
background-position:20px 50px;
如果只写了一个精确单位,另一个值省略,则第一个一定是x坐标的,另一个值默认居中对齐
background-position:20px (center);
如果两个值是精确单位和方位名词混合使用,第一个值一定是x坐标,第二个值一定是y坐标
4. background-attachment:设置背景图像是否固定或者随着页面其余部分滚动
可以制作视差滚动的效果
background-attachment:scroll(缺省) / fixed
5. 复合性写法:(提倡)
background:颜色 图片 平铺 滚动 位置
background:transparent url(XXXX) no-repeat fixed center top;
6. 背景色半透明alpha(透明度)
background:rgba(0,0,0,.5)