给你解决了底部对齐并且水平居中,父级的div的高度宽度可以随便改变,但也不会影响效果;
<div style="width:500px; height:500px; background:red; border:1px solid red; position:relative;">
<div style="width:300px; height:300px; position:absolute; left:50%; margin-left:-150px; bottom:0px; background:white;"></div>
<div style="width:500px; height:500px; background:red; border:1px solid red; position:relative;">
<div style="width:300px; height:300px; position:absolute; left:50%; margin-left:-150px; bottom:0px; background:white;"></div>