Multi columns layout feature of CSS is used to break a long text into multi-column layout text like a newspaper.
column-count
column-width
columns
column-gap
column-rule-style
column-rule-width
column-rule-color
column-rule
column-span
column-fill
Let us see each and every column property.
The column-count
property denoted the number of columns.
Source Code
.col-count {
background: #f1f1f1;
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
border: 1px solid teal;
padding: 6px;
}
The column-width
property is used to set the width of the column.
auto
: Browser will automatically assign the optimal width length-val
: You need to set the valid value of the column lengthinherit
: It will get the width from its parent .Source Code
.col-width {
background: #f1f1f1;
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
-webkit-column-width: 100px;
-moz-column-width: 100px;
column-width: 100px;
border: 1px solid teal;
padding: 6px;
}