使用.box{
width:100px;
height:100px;
background:red;
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
}
<div class=".box">
</div>
使用.box{
width:100px;
height:100px;
background:red;
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
}
<div class=".box">
</div>