css居中解决方案
flex 布局方式,写在父容器上,作用在父容器的内容上
display: flex;
justify-content: center;
align-items: center;
transform 方式
top:50%;
left:50%;
transform:translate(-50%, -50%);
position fixed 方式
div{
position:fixed;
margin:auto;
left:0;
right:0;
top:0;
bottom:0;
width:200px;
h
原创
2020-12-17 15:27:18 ·
207 阅读 ·
0 评论