flex布局水平垂直居中

flex布局教程:http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html

<div class="box"> <section class="inner"></section> </div> .box { display: flex; justify-content: center; /* 水平居中 */ align-items: center; /* 垂直居中 */ width: 1000px; height: 600px; border: 1px solid red; } .inner { width: 300px; height: 200px; background-color: red; }

猜你喜欢

转载自www.cnblogs.com/plBlog/p/12354871.html