背景

一、背景新增css属性:
1)background-origin:背景图的起始位置
①padding-box; 默认值(padding区域开始)
②border-box; 边框后面开始
③content-box; 从内容区域开始
2) background-clip:; 背景的裁切(只显示哪个区域的背景)
①border-box:;默认值
②padding-box:;
③content-box:;
3)background-size:;  控制背景图的大小
①属性值:宽度   高度
②属性值的数值:
10px  10px
100%  100%
cover       按照背景图的比例放大到全部平铺在元素后面则停止
contain     按照比例放大,当宽或者高,达到容器最高则停止
4) 多背景图的设置:
①background:url() no-repeat,url() no-repeat,url()
补:如果让背景图在不变形的情况下,填满整个内容区:  background-size:cover
原文地址:https://www.cnblogs.com/yh-3175339026/p/12693739.html