第一种方法:
position:absolute;
left:50%;
top:50%;
margin-left:-100px;
margin-top:-50px;
width:200px;
height:100px;
第二种方法:
.inner {
position:absolute;
width:199px;
height:199px;
background-color:#000;
top:50%;
left:50%;
transform:translate(-50%,-50%);
}
第三种方法:
.inner {
position:absolute;
width:199px;
height:199px;
background-color:#000;
top:0;
left:0;
right:0;
bottom:0;
margin:auto;
}