<div class="db"> <div class="dm"></div> </div> .db{ 400px; height:200px; background:#ccc; } .dm{ 50px; height:50px; background:pink; position:absolute; left:0;right:0; top:0;bottom:0; margin:auto; }
<div class="db"> <div class="dm"></div> </div> .db{ 400px; height:200px; background:#ccc; } .dm{ 50px; height:50px; background:pink; position:absolute; left:0;right:0; top:0;bottom:0; margin:auto; }