:
background-color:背景颜色
backgroune-image:背景图片 background-image: url(a.png);
background-postion:背景定位
两个 值: x 轴偏移 y 轴偏移
容器大小-背景图片的 剩余值的%
关键字: x:left(左边) center(居中) right(右边)
y:top(顶边) center bottom(底边)
只写一个属性的话,第二个属性默认居中
background-position: 负值 逆向偏移
backgroune-repeat:背景图片是否重复
repeat:默认 x,y轴方向都会重复
repeat-x:x 轴重复
repeat-y:y 轴重复
no-repeat:不重复
background属性简写:color image repeat position 各值之间用空格隔开,不分先后顺序
display:显示属性
inline:元素显示为内联元素
block:元素显示为块元素
inline-block:内联块元素
css sprites:
精灵图(雪碧图):
将多张图片拼接到一张图片中,利用背景定位来显示不同图像效果,
减少对服务器的请求次数,降低服务器的压力