首頁  >  文章  >  web前端  >  CSS flex-flow 屬性

CSS flex-flow 屬性

WBOY
WBOY轉載
2023-09-05 14:09:021339瀏覽

CSS flex-flow 属性

要同時設定 flex-directionflex-wrap 屬性,請使用單一屬性 flex-flow

#範例

您可以嘗試執行以下程式碼來實作flex-flow屬性,以設定flex的方向和wrap屬性-

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mycontainer {
            display: flex;
            background-color: orange;
            flex-flow: column wrap;
         }
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 40px;
            font-size: 25px;
            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>Q5</div>
         <div>Q6</div>
         <div>Q7</div>
         <div>Q8</div>
         <div>Q9</div>
      </div>
   </body>
</html>

以上是CSS flex-flow 屬性的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除