所以,我得到了这个:
.container_2{
overflow: hidden;
height: 200px;
width: 1900px;
color: white;
background-image: url('https://i.ibb.co/RyxFhXn/aldebaran-s-O-6kqn-Ev-O1s-unsplash.jpg');
}但是bg-image并不是全宽的,它的multiplying itself to cover the width required, rather than 覆盖了整个div容器,而不需要它的乘法。
发布于 2021-09-28 17:00:23
.container_2{
overflow: hidden;
height: 200px;
width: 1900px;
color: white;
background-image: url('https://i.ibb.co/RyxFhXn/aldebaran-s-O-6kqn-Ev-O1s-unsplash.jpg');
background-size: cover;
background-position: center;
}<div class="container_2">
</div>
这就是你需要的吗?
https://stackoverflow.com/questions/69365684
复制相似问题