gpt4 book ai didi

css - 不使用显示 :Table-Cell in CSS 的 DIV 底部文本

转载 作者:行者123 更新时间:2023-11-28 08:11:37 25 4
gpt4 key购买 nike

是否有任何其他正确的方法在底部显示文本,因为使用 Display:Table-Cell,我不能使用边距属性。

div.Product2 {
display: table-cell;
width: 250px;
height: 120px;
text-indent: 15px;
vertical-align: bottom;
padding-bottom: 10px;
letter-spacing: 1px;
background: url('../images/cp_bg.png') no-repeat center 10px #008f00;

}

最佳答案

我相信您可以在没有 table-cell 的情况下做到这一点的唯一方法是使用多个 div。您可以选择保留 table-cell 并将其放在包装器 div 中,或者只将您的文本放入子 div

div.Product2 {
/*display: table-cell;*/
width: 250px;
height: 120px;
text-indent: 15px;
/*vertical-align: bottom;*/
padding-bottom: 10px;
letter-spacing: 1px;
background: url('../images/cp_bg.png') no-repeat center 10px #008f00;
position: relative;
}

div.product3 {
position: absolute;
bottom: 0;
}
<div class="Product2">
Some Text
<div class="product3">
Bottom Text
</div>
</div>

关于css - 不使用显示 :Table-Cell in CSS 的 DIV 底部文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29235572/

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