How to specify the number of columns an element should be divided into with CSS

CSSWeb DevelopmentFront End Technology

To specify the number of columns an element should be divided into, use the column-count property.

You can try to run the following code to implement the column-count property with 4 columns

Example

Live Demo

<!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>
raja
Published on 23-May-2018 13:22:32
Advertisements