CSS Portal

CSS Column Generator

Visually configure every CSS multi-column layout property and copy production-ready code directly into your project. Adjust the number of columns or set a preferred column width, fine-tune the gaps between columns, and style the column rules with custom widths, styles, and colours. You can also experiment with typography settings such as line height and text alignment to see how content flows naturally across columns.

As you change each setting, the live preview updates instantly, letting you explore different layouts and spacing combinations in real time. This makes it easy to understand how multi-column properties interact and to quickly refine the look of long-form content such as articles, blog posts, or documentation. Once you’re happy with the result, simply copy the clean, production-ready CSS and drop it straight into your project-no manual tweaking or guesswork required.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!
CSS Column Generator

How to use

Adjust the controls in the left panel. The preview reflects your changes in real time. When you're happy with the result, hit Copy CSS and paste it into your stylesheet.

What it generates

A .container ruleset covering all standard multi-column properties, plus a .span-heading class for elements that break across the full column width.

Browser support

CSS multi-column layout is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. Properties like column-fill: balance-all may vary slightly across browsers.

Columns
3
24px
Column rule
1px
Colors
Typography
15px
1.7
Orphans & Widows
2
2
Live preview
The art of layout The CSS multi-column layout module lets you create newspaper-style columns with ease. Content flows naturally from one column to the next, just like a printed page. You can control the number of columns, the gap between them, and even add decorative rules between each column. This is a powerful tool for long-form reading experiences on the web. Columns can be balanced so they're roughly equal in height, or set to auto-fill from left to right. Combine this with orphans and widows settings to prevent awkward text breaks at the top or bottom of a column. The result is polished, readable, and beautiful layout that feels considered and intentional.
Generated CSS
Generated CSS

About this tool

A reference and prototyping tool for the CSS Multi-Column Layout specification - covering every standardised property in one place.

CSS multi-column layout

The multi-column layout module extends the normal block layout model to allow content to flow into multiple columns - similar to a newspaper or magazine. It is defined in the CSS Multi-column Layout Level 1 specification and is fully supported across all modern browsers.

Unlike CSS Grid or Flexbox, multi-column layout is content-driven: you define the structure and the browser distributes the content automatically, reflowing it as the viewport or font size changes.

Properties covered

  • column-count - sets the number of columns explicitly
  • column-width - sets an ideal column width; count adjusts to fit
  • column-gap - controls the space between columns
  • column-fill - determines how content is distributed across columns
  • column-rule - shorthand for the decorative rule drawn between columns
  • column-span - allows an element to span across all columns
  • orphans - minimum lines left at the bottom of a column
  • widows - minimum lines carried to the top of the next column

Column count vs column width

These two properties interact. Setting only column-count gives you a fixed number of columns regardless of screen width. Setting only column-width makes the layout responsive - the browser fits as many columns as possible at that width. Setting both together acts as a maximum column count with a minimum width constraint.

Orphans and widows

These typographic properties control how text breaks across column boundaries. orphans sets the minimum number of lines that must remain at the bottom of a column before a break; widows sets the minimum number of lines that must appear at the top of the next column after a break. Higher values reduce awkward isolated lines but give the browser less flexibility in balancing columns.

Column rules

A column rule is drawn in the middle of the column gap and does not take up space - it has no effect on column widths or layout. It accepts the same values as border: a width, a style (solid, dashed, dotted, double, groove, ridge), and a colour. If the gap is too narrow, the rule may overlap content.

When to use multi-column

Multi-column layout is best suited to long-form reading content - articles, documentation, reference lists - where continuous text benefits from shorter line lengths. It is less appropriate for UI layouts where precise positioning of discrete components is needed; use Grid or Flexbox for those cases instead.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Frequently Asked Questions

What is CSS multi-column layout?

CSS multi-column layout is a module that allows content to flow automatically across multiple vertical columns, similar to a newspaper or magazine. You define the structure - number of columns, column width, and gaps - and the browser distributes the content, reflowing it as the viewport or font size changes. It is best suited to long-form reading content like articles and documentation, where shorter line lengths improve readability.

What is the difference between column-count and column-width?

column-count sets a fixed number of columns regardless of screen width - if you set three columns, you always get three, no matter how wide or narrow the container. column-width sets an ideal minimum width for each column and lets the browser calculate how many columns fit - making the layout responsive automatically. When both are set together, column-count acts as a maximum and column-width acts as a minimum, so the browser never exceeds the count but also never creates columns narrower than the specified width.

How do I add a line between columns in CSS?

Use the column-rule shorthand property, which works exactly like border - it accepts a width, a style, and a colour. For example: column-rule: 1px solid #ccc;. The rule is drawn in the centre of the column gap and does not take up any space, so it has no effect on column widths or layout. If the column-gap is too narrow relative to the rule width, the rule may overlap the column content.

What does column-fill do?

column-fill controls how content is distributed across columns. balance (the default) attempts to make all columns roughly equal in height. auto fills each column from top to bottom before moving to the next, which can leave trailing columns empty. balance-all is similar to balance but also applies to the last column group - browser support for this value is more limited than the others.

How do I make an element span all columns?

Apply column-span: all; to the element you want to stretch across the full width of the multi-column container. This is typically used for headings that should sit above all columns rather than being confined to a single one. Setting column-span: none; (the default) keeps the element within its own column. Note that only none and all are valid values - there is no way to span a specific number of columns using this property.

What are orphans and widows in CSS columns?

orphans sets the minimum number of lines of text that must remain at the bottom of a column before a column break. widows sets the minimum number of lines that must appear at the top of a column after a break. Both default to 2. Higher values reduce isolated single lines - a common typographic problem - but give the browser less flexibility when balancing column heights. These properties apply to column breaks in the same way they apply to page breaks in print stylesheets.

What is the difference between CSS columns and CSS Grid?

CSS multi-column layout is content-driven: you describe the column structure and the browser flows the content automatically from one column to the next. CSS Grid is placement-driven: you define explicit rows and columns and then position each item precisely within the grid. Multi-column is better for continuous flowing text - articles, documentation, lists - where the order matters and content just needs to wrap. Grid is better for UI layouts where discrete components need to be positioned independently of one another.

What browsers support CSS multi-column layout?

CSS multi-column layout is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. Core properties like column-count, column-width, column-gap, column-rule, and column-span have excellent cross-browser support. The column-fill: balance-all value has more limited support and may behave inconsistently across browsers, so it is worth testing and providing a column-fill: balance fallback if needed.

How do I set the gap between CSS columns?

Use the column-gap property to control the space between columns. It accepts any valid CSS length value, such as column-gap: 2em; or column-gap: 24px;. The default value is 1em in most browsers. Note that column-gap is also used in Flexbox and Grid layouts, so if you are familiar with those, it works the same way. Any column-rule is drawn in the centre of this gap.

Can I use CSS columns for responsive layouts without media queries?

Yes - this is one of the strengths of the column-width property. By setting only column-width and not column-count, the browser automatically calculates how many columns fit the container at any given viewport width. On a wide screen you might get four or five columns; on a narrow mobile screen the content collapses to a single column, all with no media queries needed. This makes column-width a lightweight responsive technique for text-heavy content.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!