背景颜色: background-color
背景图片: background-image: url( )
背景平铺: background-repeat: repeat / no-repeat / repeat-x / repeat-y
背景图片位置 :
1. background-position: left top;
2. background-position: x坐标(右边) y坐标 (左边)
如果只指定一个数值, 那该数值一定是x坐标,另一个默认垂直居中
3. 参数是混合单位
如果指定的两个值是精确单位和方位名词混合使用, 则第一个值是x坐标, 第二个值是y坐标
背景图像固定 (背景附着)
background-attachment 属性设置背景图像是否固定或者随着页面的其余部分滚动
background-attachment后期可以制作视差滚动的效果
background-attachment : scroll / fixed
scroll 背景图像是随对象内容滚动
fixed 背景图像固定
// 背景图片复合写法
background: transparent url(image.jpg) repeat-y fixed top;
CSS3 为我们提供了背景颜色半透明的效果。
background: rgba(0,0,0,0.3);
最后一个参数是 alpha 透明度, 取值范围在 0 ~ 1之间