1.背景属性:
(1)背景颜色: background-color
(2)背景图片:background-image
(3)背景平铺:backgound_repeat
repeat:默认平铺
no-repeat:不平铺
repeat-x横向平铺
repeat-y:纵向平铺
(4)背景位置:background-position
(5) 背景固定滚动:background-attachment
(6)背景图片尺寸大小:background-size
2.背景位置:background-position :x,y
取值:x,y
举例:background-position:100px,100px
取值关键词:x ==== left,right,center
y ===== top bottom center
3.背景的复合属性:
background:cloor image repeat position/size attachment
background :后面可以跟一个属性实现一个效果,也可以跟多个属性实现多个效果
background-red 背景颜色
background:red url(路径) 背景颜色和背景的图片
注意:多个值可以使用空格分隔,但是位置和大小的顺序不能调整,必须使用/分隔,前面位置/后面大小
4.窗口的自适应:
html,body{
示例: height:100%
}
5.等比例放大
background-size:cover
6.背景的滚动和固定
background-attachment
取值:scroll ==== 滚动
fixed ===== 固定