背景缩写属性可以在一个声明中设置所有的背景属性。如:
background: rgba(0,0,0,0) url(../img/login_bg.jpg) no-repeat fixed center/cover;
可以设置的属性分别是:background-color, background-position, background-size, background-repeat, background-origin, background-clip, background-attachment,和background-image.
值 | 说明 | CSS |
---|---|---|
background-color | 指定要使用的背景颜色 | 1 |
background-position | 指定背景图像的位置 | 1 |
background-size | 指定背景图片的大小 | 3 |
background-repeat | 指定如何重复背景图像 | 1 |
background-origin | 指定背景图像的定位区域 | 3 |
background-clip | 指定背景图像的绘画区域 | 3 |
background-attachment | 设置背景图像是否固定或者随着页面的其余部分滚动。 | 1 |
background-image | 指定要使用的一个或多个背景图像 | 1 |
菜鸟教程的 background 介绍:https://www.runoob.com/css/css-background.html