适当的方法来中心div
这个问题在这里已经有了答案:
  如果你问的是如何垂直居中div的内容,你可以使用display: flex; 
尝试这个:
.site-wrapper {
     height: 75%;
     display: flex;
     align-items: center; /*Horizontally centers content*/
     justify-content: center; /*Vertically centers content*/
     flex-direction: column; /* Makes content in div to flow under instead of side by side*/
 }
div元素是一个块元素,因此如果你想水平居中,最简单的方法就是使用margin自动方法。
.site-wrapper{
 width:1200px; //you have to give specific width value
 margin: 0 auto;}
                        链接地址: http://www.djcxy.com/p/75907.html
                        
                        
                    