很多人在以往的頁面製作中用valign:bottom實現底部對齊。
但是在xHTML中,CSS中沒有了這個就不知道如何是好,以下爲解決方法:
css:
position : relative ;
background : red ;
height : 100px ;
width : 100px ;
}
#box2 {
position : absolute ;
background : #BBB ;
height : 20% ;
width : 100% ;
left : 0 ;
bottom : 0 ;
}
html:
<div id="box2">在下邊了</div>
</div>