Flexbox实现垂直水平居中

<div class="box">
        <div style=" 100px;height:150px;">
            解析:本题主解析:本题主解析:本题主
        </div>
    </div>
    <style type="text/css">
        .box {   
            display: flex;  
            align-items: center;  //垂直

    -webkit-align-items: center;//兼容浏览器写法
            justify-content: center; //水平

    -webkit-justify-content: center;//兼容浏览器写法
            height: 500px;
            300px;
        }  
    </style>

原文地址:https://www.cnblogs.com/web-leader/p/5674277.html