使用 CSS 指定列寬度


使用 *column-width* 屬性指定列的寬度。你可以嘗試執行以下程式碼來實現 *column-width* 屬性 −

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-count: 4;
            column-rule-color: gray;
            column-rule-style: dashed;
            column-width: 100px;
         }
      </style>
   </head>
   <body>
      <div class = "demo">
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
      </div>
   </body>
</html>

更新於:2020 年 6 月 24 日

66 次瀏覽

開啟你的職業生涯

完成課程進行認證

立即開始
廣告