使用 align-items屬性,值為 center,將彈性項置中對齊。 範例 您可以嘗試執行以下程式碼來實作center值 即時示範 .mycontainer { display: flex; background-color: orange; align-items: center; height: 150px; width: 600px; } .mycontainer > div { background-color: white; text-align: center; line-height: 40px; font-size: 25px; width: 100px; margin: 5px; } Quiz Q1 Q2 Q3 Q4 登入後複製