※ flex-wrap:nowrap (超出不換行,很奇怪裏面的寬度會變成100%)css
※ flex-start (水平左對齊)html
※ align-items:stretch; (默認)web
還沒搞明白基線對齊是什麼意思。佈局
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #box{ display: flex; display: -webkit-flex; border: 1px solid #0000FF; height: 200px; width: 400px; align-items:center; justify-content:center; } .item{ width: 50px; height: 40px; border: 1px solid #00C1B3; } </style> </head> <body> <div id="box"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> </div> </body> </html>