CSS align-items 屬性 flex-end 值的使用方法


使用值flex-endalign-items屬性可在底部對齊彈性項。

你可以嘗試執行以下程式碼來實現flex-end

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mycontainer {
            display: flex;
            height: 300px;
            background-color: red;
            align-items: flex-end;
         }
         .mycontainer > div {
            background-color: orange;
            text-align: center;
            line-height: 60px;
            font-size: 30px;
            width: 100px;
            margin: 5px;
         }
      </style>
   </head>
   <body>
      <h1>Quiz</h1>
      <div class = "mycontainer">
         <div>Q1</div>
         <div>Q2</div>
         <div>Q3</div>
         <div>Q4</div>
      </div>
   </body>
</html>

更新日期:24-Jun-2020

106 瀏覽次數

開啟你的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.