1、background-image:url("图片地址“) 背景图 (是css样式,可以盖住背景图)
2、background-repeat:no-repeat/repeat;背景图不平铺/平铺
background-repeat:no-repeat-x;水平方向重铺
background-repeat:no-repeat-y;垂直方向重铺
3、background-color:背景颜色/十六进制/三原色
4、background-position:背景定位;
关键字:水平值 left right center
垂直值 top bottom center
5、综合写法:background:颜色 图片 是否重复 定位 关联;
6、background-attachment:scroll/fixed;背景关联滚动/固定
补充知识点:
1、外部样式:外部样式可以针对多个页面起作用的前提条件,需要页面进行引入
引入方式:
<link rel="stylesheet" fref="style/css"> 不能写在style标签内,
@import url("style/css")必须写在style标签的第一行,
区别:一个是标签,一个是css样式的一种写法。优先加载link,后加载@import。link没有兼容性问题,js能控制link标签,@import有兼容性问题,js不能控制@import标签