用 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>

更新於: 24-6-2020

134 次瀏覽

開啟您的 職業

完成課程即可獲得認證

開始吧
廣告