一个div在另一个div中垂直居中的方法

.parent {
            width:800px;
            height:500px;
            border:2px solid #000;
            display:flex;
            justify-content:center;
            align-items:center;
        }
 .child {
            width:200px;
            height:200px;
            background-color: red;
        }
posted @ 2018-09-23 22:32  萌萌0104  阅读(2202)  评论(0编辑  收藏  举报