Last updated: 12 March 2026

Tailwind CSS Columns

Create newspaper-style multi-column layouts in Tailwind CSS with columns-1 to columns-12, fixed-width columns, and responsive column configurations.


Interactive Columns Playground

Try each class live and inspect the CSS output.

Columns help split long content into balanced multi-column layouts.

Utility class
columns-2
CSS output
columns: 2;

The columns-* utilities in Tailwind CSS create multi-column layouts where content flows from one column to the next — like a newspaper or magazine. Unlike CSS Grid, columns automatically distribute content vertically, making them ideal for masonry-style layouts, image galleries, and flowing text.

How to Set Tailwind Columns

Apply columns with the columns-{count} class:

HTML
1<div class="columns-3 gap-4">
2 <p>First paragraph flows into column 1...</p>
3 <p>Second paragraph continues in column 1 or 2...</p>
4 <p>Content automatically distributes across columns.</p>
5</div>
Block 1
Block 2 with more content inside it
Block 3
Block 4 with even more content to show how columns distribute
Block 5
Block 6

Column Count Classes

Set the number of columns:

| Class | Columns | |-------|---------| | columns-1 | 1 column | | columns-2 | 2 columns | | columns-3 | 3 columns | | columns-4 | 4 columns | | columns-5 | 5 columns | | columns-6 | 6 columns | | columns-7 | 7 columns | | columns-8 | 8 columns | | columns-9 | 9 columns | | columns-10 | 10 columns | | columns-11 | 11 columns | | columns-12 | 12 columns | | columns-auto | Browser decides |

Fixed-Width Column Classes

Instead of a column count, set a target width and let the browser figure out how many fit:

| Class | Column Width | |-------|-------------| | columns-3xs | 16rem (256px) | | columns-2xs | 18rem (288px) | | columns-xs | 20rem (320px) | | columns-sm | 24rem (384px) | | columns-md | 28rem (448px) | | columns-lg | 32rem (512px) | | columns-xl | 36rem (576px) | | columns-2xl | 42rem (672px) | | columns-3xl | 48rem (768px) | | columns-4xl | 56rem (896px) | | columns-5xl | 64rem (1024px) | | columns-6xl | 72rem (1152px) | | columns-7xl | 80rem (1280px) |

HTML
1<div class="columns-sm gap-6">
2 <!-- Browser creates as many ~384px columns as fit -->
3</div>

Column Gap

Control spacing between columns with gap-{size}:

HTML
1<div class="columns-3 gap-8">
2 <p>Content with wider column gaps.</p>
3</div>
Gap 8
Between columns
Wider spacing

Preventing Column Breaks

Stop elements from being split across columns with break-inside-avoid:

HTML
1<div class="columns-3 gap-4">
2 <div class="break-inside-avoid bg-white rounded-lg p-4 mb-4">
3 This card won't be split across columns.
4 </div>
5 <div class="break-inside-avoid bg-white rounded-lg p-4 mb-4">
6 Neither will this one.
7 </div>
8</div>

Card 1

This card stays in one column and doesn't break.

Card 2

Short card.

Card 3

Another card with some more content to demonstrate the flow between columns.

Card 4

Final card in the grid.

Break After / Break Before

Force column breaks at specific points:

HTML
1<div class="columns-2">
2 <p>First column content</p>
3 <p class="break-after-column">This ends column 1</p>
4 <p>This starts column 2</p>
5</div>

| Class | Effect | |-------|--------| | break-after-column | Force a break after this element | | break-before-column | Force a break before this element | | break-inside-avoid | Prevent breaks inside this element | | break-inside-avoid-column | Prevent column breaks inside |

A common pattern — images of different heights flowing naturally:

HTML
1<div class="columns-3 gap-4">
2 <img class="w-full mb-4 rounded-lg break-inside-avoid" src="/photo1.jpg" alt="Photo 1" />
3 <img class="w-full mb-4 rounded-lg break-inside-avoid" src="/photo2.jpg" alt="Photo 2" />
4 <img class="w-full mb-4 rounded-lg break-inside-avoid" src="/photo3.jpg" alt="Photo 3" />
5 <img class="w-full mb-4 rounded-lg break-inside-avoid" src="/photo4.jpg" alt="Photo 4" />
6</div>

Responsive Columns

Change the column count at different breakpoints:

HTML
1<div class="columns-1 sm:columns-2 lg:columns-3 xl:columns-4 gap-4">
2 <!-- 1 column on mobile, scales up to 4 on desktop -->
3</div>

✏️ Arbitrary Value Usage

Set a custom column count or width:

HTML
1<div class="columns-[200px]">
2 <!-- Columns are exactly 200px wide -->
3</div>
4
5<div class="columns-[5]">
6 <!-- Exactly 5 columns -->
7</div>

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates