<div class='parent'>
<div class='child'>DEMO</div>
</div>
.parent {
display:flex;
justify-content:center;
align-items:center;
}
以上 满足水平垂直居中;
<div class='parent'>
<div class='child'>DEMO</div>
</div>
.parent {
display:flex;
justify-content:center;
align-items:center;
}
以上 满足水平垂直居中;