[英]vertical-align <h2> in a <div>
我有以下代碼:
<div style="height: 120px; background: none repeat scroll 0% 0% rgb(45, 144, 234); color: rgb(255, 255, 255); vertical-align: bottom;">
<div style="vertical-align: bottom; height: 120px;">
<h2 style="vertical-align: bottom; height: 120px;">text</h2>
</div>
</div>
我無法將文本放到嵌套div的底部。 我不能使用padding-top或margin-top,因為我偶爾會有文字換行。
有人可以建議我嗎?
<div style="display:table-cell; vertical-align:bottom;">Personal Information</div>
<div style="height: 120px;">
<div style="height: 120px;">
<h2 style="position: absolute; bottom: 0">text</h2>
</div>
</div>
那應該工作。
現在, h2
文本多長時間都無關緊要,它停留在yout div
的底部。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.