在卡片视图中,圆角效果在具有文本视图的图像底部不起作用可能是由于以下几个原因造成的:
border-radius
没有正确应用到所有相关元素上。<div class="card">
<img src="example.jpg" alt="Example Image" class="card-img">
<div class="text-view">
<h3>Card Title</h3>
<p>This is a description of the card.</p>
</div>
</div>
.card {
width: 300px;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.card-img {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 10px;
}
.text-view {
padding: 16px;
background-color: #fff;
border-radius: 0 0 10px 10px;
}
通过上述方法,可以确保卡片视图中的圆角效果在图像底部也能正确显示。
领取专属 10元无门槛券
手把手带您无忧上云