设置div里的内容在最底部
<div class="bottom">
<p>...content...</p>
</div>
div.bottom {
position:relative;
}
div.bottom p {
position:absolute;
bottom:0;
}
本文介绍了一种使用CSS将div内部的内容放置于容器底部的方法。通过设置div为相对定位,并将其内部元素设置为绝对定位并指定bottom为0,可以轻松实现这一效果。
设置div里的内容在最底部
<div class="bottom">
<p>...content...</p>
</div>
div.bottom {
position:relative;
}
div.bottom p {
position:absolute;
bottom:0;
}
3万+
1811
1121
1116
7688

被折叠的 条评论
为什么被折叠?