The CSS Multi-Column Layout Module allows block text to flow smoothly into multiple side-by-side vertical columns, exactly like a traditional print newspaper or magazine article. Unlike Flexbox or Grid, text in a multi-column container flows naturally from the bottom of column 1 to the top of column 2.
| Property | Standard Values | Visual Formatting Effect |
|---|---|---|
column-count |
2, 3, 4 |
Sets the explicit number of columns. |
column-width |
250px, 15rem |
Specifies the ideal column width (browser auto-determines count). |
column-gap |
30px, 2rem |
Sets the whitespace gutter between text columns. |
column-rule |
1px solid #e2e8f0 |
Draws a decorative vertical dividing line between columns. |
column-span |
all, none |
Allows an element (like an <h2>) to break across all columns. |
.magazine-article {
column-count: 3;
column-gap: 35px;
column-rule: 1px solid #e2e8f0;
text-align: justify;
}
/* Headline spans across all 3 columns */
.magazine-article h2 {
column-span: all;
margin-bottom: 20px;
color: #d22b2b;
}
Boost your CSS and front-end development proficiency by exploring these closely connected topics:
Understand margins, borders, padding, content and the universal box-sizing fix.
Master 1D alignment, justify-content, align-items, flex-wrap and responsive flow.
Build powerful two-dimensional grid layouts with template areas and fr units.
Eliminate styling conflicts and master selector weights from 0,0,0,1 to !important.