Computer >> Computer tutorials >  >> Programming >> CSS

Shorthand property to set columns with CSS


Use the columns property to set columns with CSS. You can try to run the following code to implement the columns property:

Example

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-rule-color: gray;
            columns: 100px 4;
            column-rule-style: dashed;
         }
      </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>