给定以下 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>
https://stackoverflow.com/questions/526035/