<style type="text/css">
div{
width: 200px;
height: 200px;
background-color: pink;
position: absolute;
left: 50%;
margin-left: -100px;/*margin-left负值,表示盒子往左平移100像素*/
}
</style>
<style type="text/css">
div{
width: 200px;
height: 200px;
background-color: pink;
position: absolute;
left: 50%;
margin-left: -100px;/*margin-left负值,表示盒子往左平移100像素*/
}
</style>