CSS Multicolumn Layout
Create newspaper-style layouts with flowing text columns. Perfect for articles, blogs, and content-heavy designs that prioritize readability.
How do I create newspaper-style columns in CSS?
Use multi-column layout: column-count: 3 splits an element's content into three columns that text flows through, like a newspaper. Use column-width to create as many columns as fit at a minimum width, column-gap for spacing, and column-rule for a divider line.
article {
column-width: 18rem; /* as many ≥18rem columns as fit */
column-gap: 2rem;
column-rule: 1px solid #ddd;
}
h2 { column-span: all; } /* heading across all columns */
figure { break-inside: avoid; }Interactive Multicolumn Demo
Key Concepts
Essential definitions and concepts for understanding multicolumn in CSS.
Code Editor
<div class="multicolumn-content">
<h2>Multi-column Layout</h2>
<p>This text automatically flows across multiple columns, creating a magazine-style layout. The browser handles content distribution automatically.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>Preview
What is CSS Multicolumn Layout?
CSS Multicolumn Layout allows content to flow into multiple columns, creating newspaper-style layouts that improve readability by controlling line length. It's specifically designed for flowing text content across columns automatically.
Key Benefits
- • Improved text readability
- • Automatic content distribution
- • Professional magazine-style layouts
- • Minimal CSS required
- • Responsive by nature
Best Use Cases
- • Articles and blog posts
- • News websites
- • Documentation pages
- • Long-form content
- • Print-style layouts
Column Properties
Column Count & Width
column-count
column-count: auto | 2 | 3 | 4;Sets the ideal number of columns into which the content should be flowed.
column-width
column-width: auto | 250px | 15rem;Sets the ideal column width. Browser calculates column count based on available space.
columns (shorthand)
columns: 3 250px; /* count width */Shorthand for column-count and column-width
Column Gaps & Rules
column-gap
column-gap: normal | 1rem | 30px;Sets the size of the gap between columns. Default is 1em.
column-rule
column-rule: 1px solid #ccc;Shorthand for column-rule-width, column-rule-style, and column-rule-color.
Column Fill & Balance
column-fill: auto | balance;auto
Columns are filled sequentially; some may be partially filled
balance (default)
Content is distributed evenly across all columns
Content Control Properties
Column Spanning
column-span: none | all;none (default)
Element does not span columns; flows with regular content
all
Element spans across all columns (like headings)
Column Breaks
break-before
break-before: auto | column | avoid-columnControls breaking before element
break-after
break-after: auto | column | avoid-columnControls breaking after element
break-inside
break-inside: auto | avoid | avoid-columnControls breaking inside element
Practical Examples
Basic Article Layout
.article {
column-count: 3;
column-gap: 2rem;
column-rule: 1px solid #ddd;
}
.article h1 {
column-span: all;
margin-bottom: 2rem;
}Classic newspaper-style layout with spanning headline
Responsive Columns
.content {
column-width: 250px;
column-gap: 1.5rem;
}
@media (max-width: 768px) {
.content {
column-count: 1;
}
}Adaptive columns based on screen size
Magazine Layout
.magazine {
columns: 2 300px;
column-gap: 3rem;
column-rule: 3px double #333;
text-align: justify;
}
.pull-quote {
column-span: all;
font-size: 1.5em;
text-align: center;
margin: 2rem 0;
}Professional magazine-style with pull quotes
Break Control
.content {
column-count: 3;
column-gap: 2rem;
}
.keep-together {
break-inside: avoid;
padding: 1rem;
border: 1px solid #ddd;
}
.section-break {
break-before: column;
}Control where content breaks between columns
Best Practices & Considerations
Best Practices
- • Use for text-heavy content layouts
- • Consider readability with line length
- • Test with varying content amounts
- • Use column-span for section headings
- • Control breaks for better flow
- • Provide single-column mobile fallback
Advanced Tips
- • Combine with other layout methods
- • Use orphans and widows for fine control
- • Consider print stylesheets
- • Test content breaking points
- • Use CSS containment for performance
- • Handle images and media carefully
Accessibility Considerations
Multicolumn layouts can be challenging for screen readers. Ensure content flows logically and consider providing alternatives for users who prefer single-column reading.
Browser Support
Multicolumn layout has good browser support. Some advanced features may require vendor prefixes. Always provide fallbacks for older browsers.
CSS Multicolumn — step by step
column-count and column-width
column-count: 3 divides content into 3 columns. column-width: 200px lets the browser decide how many columns fit at that minimum width.
🎯 Quick Check
Which property makes an element span across ALL columns in a multicolumn layout?
CSS Multi-column Layout: summary
Key points
- Content flows down the first column, then into the next, unlike Grid, which fills across rows.
break-inside: avoidstops an item such as a card or figure from being split between columns.- It's good for a masonry-style list of variable-height cards, as long as top-to-bottom order is fine.
Frequently asked questions
›What is the difference between column-count and column-width?
column-count fixes the number of columns. column-width sets a minimum width and lets the browser decide how many fit, which makes it responsive automatically.
›Can I use multi-column for a masonry layout?
Yes. Put cards in a multi-column container with break-inside: avoid. Items are ordered down each column rather than across.