使用 CSS 指定列之間的間距


使用 column-gap 屬性設定列之間的間距。嘗試執行以下程式碼實現 column-gap 屬性,值為 50px

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-count: 4;
            column-gap: 50px;
         }
      </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 日

134 次瀏覽

啟動你的職業生涯

透過完成課程來獲得認證

開始
廣告
© . All rights reserved.