我想在图像中包含一个段落,但它总是溢出。
我希望图像的大小调整得足够长,与段落一样长。
我尝试过使用最小高度,但不起作用。
.image-container{
position: relative;
min-height:100vh;
width: 100%;
justify-content:center;
align-items:center;
display:flex;
}
.truck-image{
position: relative;
top:50px;
object-fit: cover;
width:100%;
height:100%;
}
.text-container{
position: absolute;
top:110px;
left:0;
padding-left: 100px;
width:30%;
color:white;
z-index:3;
}
我想象使用最小高度会在调整大小时根据其屏幕调整容器的大小,从而调整图像的大小,但事实并非如此。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号