<div></div>
// position: relative 居中
div{
width: 100px;
height: 100px;
margin: 0 auto;
background-color: blue;
}
// position: absolute 居中
div{
width: 100px;
height: 100px;
position: absolute;
left: 50%;
margin-left: -50px;
text-align: center;
background-color: blue;
}