其中,color-name可以是任何有效的CSS颜色名称或十六进制颜色值。
2、背景图片:
background-image:url('image-url');
其中,image-url是图片的URL地址。
3、背景重复:
background-repeat:repeat-style;
其中,repeat-style可以是repeat、repeat-x或repeat-y,表示背景图片是否需要平铺或沿特定方向平铺。
4、背景位置:
background-position:position-style;
其中,position-style可以是left、center或right,表示背景图片在页面中的位置。
5、背景大小:
background-size:size-style;
其中,size-style可以是auto、cover或contain,表示背景图片的大小。
6、背景attachment:
background-attachment:scroll-style;
其中,scroll-style可以是scroll、fixed或local-origin,表示背景图片是否随页面滚动、固定在页面上方或与页面一起滚动。
7、背景颜色和图片:
background:color-nameurl('image-url');
可以将背景颜色和背景图片一起设置。
8、背景渐变:
background-image:linear-gradient(direction,color-stop1,color-stop2,...);
其中,direction是渐变方向,可以是tobottom、totop、toleft、toright或round。color-stop是渐变颜色,可以有多个,用逗号分隔。
THE END