<div class="db"> <div class="dm"></div> </div> .db{ width:400px; height:200px; background:#ccc; } .dm{ width:50px; height:50px; background:pink; position:absolute; left:0;right:0; top:0;bottom:0; margin:auto; }
移动端absolute元素居中
猜你喜欢
转载自www.cnblogs.com/bubuchu/p/10585191.html
今日推荐
周排行