gpt4 book ai didi

css - 背景图像的设置

转载 作者:行者123 更新时间:2023-11-28 17:07:39 26 4
gpt4 key购买 nike

我的 background-image 设置有一些问题。有人知道为什么 .box-3 没有把 .box-2 推开吗?

 .box-1 {
height: 250px;
width: 100%;
background-image: url(https://article.images.consumerreports.org/prod/content/dam/CRO%20Images%202017/Magazine-Articles/April/Google-Auto-Profile-images-2017/PRF-203);
}

.box-2 {
width: 100%;
height: 50px;
background-color: #000;
color: #fff;

}




<div class="box-1">
<div class="row">
<div class="col-lg-6">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Lorem ipsum dolor sit amet, consetetur
</div>
<div class="col-lg-6">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Lorem ipsum dolor sit amet, consetetur
</div>
</div>
</div>

<div class="box-2">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
</div>

最佳答案

box-1 的最小高度阻止它变得更高,将 height: 250px 更改为 min-height: 250px

.box-1 {
min-height: 250px;
width: 100%;
background-image: url(https://article.images.consumerreports.org/prod/content/dam/CRO%20Images%202017/Magazine-Articles/April/Google-Auto-Profile-images-2017/PRF-203);
}

.box-2 {
width: 100%;
height: 50px;
background-color: #000;
color: #fff;
float: left;
}

关于css - 背景图像的设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48442587/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com