Specify Width for the Columns with CSS



Use the column-width property to specify the width of the columns. You can try to run the following code to implement the column-width property −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-count: 4;
            column-rule-color: gray;
            column-rule-style: dashed;
            column-width: 100px;
         }
      </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>
Updated on: 2020-06-24T13:53:01+05:30

92 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements