Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

ระบุช่องว่างระหว่างคอลัมน์ด้วย 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>