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: 24-Jun-2020

51 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements