div{
width: 600px;
height: 60px;
background: #13ce66;
position: absolute;
left: 50%;
top: 0;
margin-left: -300px; /组件真实宽度的一半 这里是600的一半/
}
div盒子居中
最新推荐文章于 2023-08-13 00:34:20 发布
div{
width: 600px;
height: 60px;
background: #13ce66;
position: absolute;
left: 50%;
top: 0;
margin-left: -300px; /组件真实宽度的一半 这里是600的一半/
}