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

วิธีเติมคอลัมน์ด้วย CSS


เมื่อต้องการเติมคอลัมน์ ให้ใช้คุณสมบัติการเติมคอลัมน์ คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้คุณสมบัติการเติมคอลัมน์ด้วยรูปแบบยอดคงเหลือ:

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-count: 4;
            column-fill: balance;
         }
      </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>