方法1
.demo1{
position:absolute;
top:50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
方法2
.demo2{
display: flex;
align-items: center;
justify-content: center;
}
方法3
.parent-panel2:after{
content:"";
display: inline-block;
vertical-align: middle;
height: 100%;
}
定宽度
.demo4{
position:absolute;
top:50%;
left:50%;
margin-top:(width/2);
margin-left:(width/2);
}
正文完
要饭中,多少给点吧(支付宝)