<style>
.beCenter { width:460px; height:212px; background:#ccc; margin:0px auto; } .beAllCenter{ width:460px; height:212px; background:#f00; margin-left:-230px; margin-top:-106px; position:absolute; top:50%; left:50%; }</style><div style="width:800px; height:600px; text-align:center; position:relative"> <div class="beCenter"></div> <div class="beAllCenter"></div></div>原文:http://www.cnblogs.com/xl900912/p/4347429.html