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

วิธีระบุจำนวนคอลัมน์ที่องค์ประกอบควรแบ่งออกเป็น CSS


หากต้องการระบุจำนวนคอลัมน์ที่องค์ประกอบควรแบ่งออกเป็น ให้ใช้คุณสมบัติการนับคอลัมน์

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

ตัวอย่าง

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