一个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;
        }

猜你喜欢

转载自www.cnblogs.com/mmjoy/p/9694019.html