前言
有时候,我们希望容器背景大图片自动适用容器宽高,均匀平铺在页面,几行 CSS
代码即可搞定。
给父容器设置即可。
.view{
background-image: url(x.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}