CSS multi-column generator — newspaper-style text columns

Choose how many columns, the gap between them, a dividing line and an optional minimum column width, and the tool writes multi-column CSS that also keeps paragraphs whole and lets the heading span the full width.

Live demo · real result from this tool

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the CSS multi-column generator

  1. Set column-count from 1 to 6.
  2. Set the column-gap, from 0 to 80 px.
  3. For a dividing line, set Rule width above 0 and choose the Rule style and Rule colour. Width 0 removes it.
  4. To make the layout responsive, set Minimum column width (0 = off), for example 220 px.
  5. Keep Heading spans all columns ticked if your block starts with an h2 title, then copy the CSS.

What it does and when to use it

Multi-column layout splits one piece of content into side-by-side columns, the way newspapers and magazines do. It suits glossaries, long link lists, tag clouds, short news summaries, FAQ indexes and footers, where many small items would otherwise run down one long, narrow column.

For laying out separate cards in rows, the CSS grid generator or the flexbox generator is the better choice. To set comfortable body text inside each column, start with the typography styler.

How it works

The .columns rule uses either column-count: <n> or, when a minimum width is set, columns: <n> <width>. It adds column-gap and, if the rule width is above 0, column-rule: <width> <style> <colour>. Two helper rules follow: .columns h2 { column-span: all; } when the heading option is on, and .columns p { break-inside: avoid; } always.

MDN lists columns and column-rule as Baseline widely available since March 2017, break-inside since January 2019 and column-span since July 2020.

Worked examples

Default three columns with a rule:

.columns {
  column-count: 3;
  column-gap: 32px;
  column-rule: 1px solid #cbd5e1;
}
.columns h2 {
  column-span: all;
}
.columns p {
  break-inside: avoid;
}

A responsive link list. Count 3, minimum width 220 px, gap 24 px, no rule, heading option off: columns: 3 220px; with column-gap: 24px;. In a 500 px wide box there is room for two 220 px columns plus the gap, so you get two; in a 1,000 px box you get three.

Limits and tips

  • Columns balance automatically. The browser tries to make them equal height, so the last column may be shorter than expected.
  • Only paragraphs are kept whole. Add break-inside: avoid to list items, figures or cards if they should not split either.
  • Nested headings other than h2 need their own column-span: all rule if they should cross all columns.

Frequently asked questions

What is the difference between column-count and columns?
column-count always makes that many columns, however narrow the screen. The columns shorthand with a width, such as 3 220px, means at most 3 columns, each at least 220px wide, so a phone gets one column and a wide screen three. The tool uses columns when you set a minimum width.
Does the column rule take up space?
No. The rule is drawn in the middle of the gap. If it is wider than the gap, it simply overlaps the text, so keep the gap larger than the rule.
Why is break-inside avoid added to paragraphs?
Without it a paragraph can start at the bottom of one column and finish at the top of the next. break-inside avoid moves short paragraphs to the next column whole when they would otherwise be split.
Should I use columns for long articles?
Be careful. On a screen shorter than the text, readers must scroll down one column, back up, and down again. Columns work best for short blocks such as lists, link groups, footers and cards with little text.
Is this the same as CSS grid?
No. Multi-column flows one stream of content from column to column like a newspaper. Grid places separate items into rows and columns you define.

Sources

  1. columns - CSS | MDN — MDN Web Docs, accessed 2026-10-08
  2. column-span - CSS | MDN — MDN Web Docs, accessed 2026-10-08
  3. break-inside - CSS | MDN — MDN Web Docs, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close