[转]在css+div里面实现div的底对齐
1、之前代码:
<style>#parent{width:300px;height:300px;background:gray;}#i_want_to_be_bottom{width:100px;height:30px;background:red;}</style><div id="parent"> <div id="i_want_to_be_bottom"></div></div>?![[转]在css+div里头实现div的底对齐](http://img.reader8.net/uploadfile/jiaocheng/2014/0125/2014012519220113350.gif)
修改后代码:
<style>#parent{width:300px;height:300px;background:gray;position:relative;}#i_want_to_be_bottom{width:100px;height:30px;background:red;position:absolute;bottom:0px;}</style><div id="parent"> <div id="i_want_to_be_bottom"></div></div>?![[转]在css+div里头实现div的底对齐](http://img.reader8.net/uploadfile/jiaocheng/2014/0125/2014012519220113351.gif)
?变动点提示