似乎底部div對齊頁面底部,但不是容器div。我需要將底部對齊到容器DIV的底部。如何將一個div頂部和另一個底部與容器div對齊?
代碼:
#container {
border: 1px solid red;
height: 300px;
}
#top {
border: 2px solid red;
display: inline-block;
vertical-align: top;
position: absolute;
top: 0;
}
#bottom {
border: 2px solid red;
vertical-align: bottom;
width: 100px;
position: absolute;
bottom: 0;
}
<div id="container">
<div id="top">
test<br /> test
<br /> test
<br /><br /> test test test test<br />
</div>
<div id="bottom">bottom</div>
</div>