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

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

ใช้คุณสมบัติ column-fill เพื่อควบคุมวิธีการเติมเนื้อหาในคอลัมน์ ค่า balance จะกระจายเนื้อหาให้เท่ากัน

ตัวอย่าง: balance

<!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. This is demo text. This is demo text.          This is demo text.       </div>    </body> </html>