不定宽高盒子水平垂直居中的写法

1. 1200px;
    height: 600px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
2. 1200px;
    height: 600px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin:-300px 0 0 -600px;

原文地址:https://www.cnblogs.com/isylar/p/4843340.html