flex布局水平垂直居中


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; /* 垂直居中 */ width: 1000px; height: 600px; border: 1px solid red; } .inner { width: 300px; height: 200px; background-color: red; }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM