[转]在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>
?
修改后代码:
<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>
?
?变动点提示