css背景

1、背景:背景色、背景图

2、背景色

(1)     、英文单词   background-color: blue;

(2)     、十六进制    background-color: #ff0000;

(3)     、 RGB   红绿蓝     background-color: rgb(0, 255, 0);

(4)     、rgba   红绿蓝透明度   background-color: rgba(255, 0, 0, 0.5);

①    取值范围0-1

②     1是完全不透明 ,0是完全透明

(5)     、补充透明度 opacity: 0.5

 3、背景图

(1)、background-image  背景图片地址

参数:none:无背景图(默认的)

url:使用绝对或相对地址指定背景图像

(2)、background-repeat   是否平铺

参数:repeat:背景图像在纵向和横向上平铺(默认的)

no-repeat:背景图像不平铺
repeat-x:背景图像在横向上平铺
repeat-y:背景图像在纵向平铺

(3)、background-position   背景位置

参数:length:百分数|由浮点数字和单位标识符组成的长度值。请参阅长度单位

position:top | center | bottom | left | center | right

原文地址:https://www.cnblogs.com/wangxue13/p/13512854.html