给定以下 HTML:
<div id="container">
<!-- Other elements here -->
<div id="copyright">
Copyright Foo web designs
</div>
</div>
我希望 #copyright
贴在 #container
的底部。我可以在不使用绝对定位的情况下实现这一点吗?
最佳答案
可能不会。
将position:relative
赋值给#container
,然后position:absolute; bottom:0;
到 #copyright
.
#container {
position: relative;
}
#copyright {
position: absolute;
bottom: 0;
}
<div id="container">
<!-- Other elements here -->
<div id="copyright">
Copyright Foo web designs
</div>
</div>
关于html - 如何将我的 div 放在其容器的底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/526035/