flex布局教程:http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html
教程2: https://www.jianshu.com/p/c71b65a2b3e2
flexDirection、justifyContent、alignItems的简单使用
https://www.jianshu.com/p/c390042d6140
<div class="box"> <section class="inner"></section> </div> .box { display: flex; justify-content: center; /* 水平居中 */ align-items: center; /* 垂直居中 */ 1000px; height: 600px; border: 1px solid red; } .inner { 300px; height: 200px; background-color: red; }