CSS column-gap Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Layout & Columns

What You’ll Learn

The column-gap property sets the space between columns in a multi-column layout — helping content stay readable and visually organized.

01

Column Space

Gap between cols.

02

Syntax

Length or normal.

03

normal Default

Browser spacing.

04

px / rem

Fixed gap sizes.

05

column-count

Pair together.

06

Readability

Cleaner layouts.

Definition and Usage

The column-gap CSS property sets the width of the gap (space) between columns in a multi-column layout. It helps create visually appealing layouts by controlling the space between columns, ensuring content is easily readable and well organized.

Apply it to any block container that uses column-count or column-width. A comfortable gap prevents text in neighboring columns from feeling crowded.

💡
Beginner Tip

Start with column-gap: 1.5rem or 20px on three-column text layouts, then adjust until the spacing feels right.

📝 Syntax

The syntax for column-gap is simple — apply it to any multi-column element:

syntax.css
selector {
  column-gap: value;
}

Basic Example

column-gap-20px.css
.column-layout {
  column-count: 3;
  column-gap: 20px;
}

Syntax Rules

  • The initial value is normal.
  • Accepts length values: px, em, rem, %, and others.
  • Requires a multi-column context — use with column-count or column-width.
  • Only affects horizontal space between columns, not vertical spacing.
  • Also used for column gaps in CSS Grid (separate from multi-column layout context).

⚡ Quick Reference

QuestionAnswer
Initial valuenormal
Applies toMulti-column containers and Grid containers
InheritedNo
AnimatableYes, as a length
Common useSpacing between columns in article and magazine layouts

💎 Property Values

The column-gap property accepts a length or the keyword normal.

ValueExampleMeaning
lengthcolumn-gap: 20px;Specifies a fixed width for the gap between columns, such as 20px, 1em, or 2rem.
normalcolumn-gap: normal;Uses the browser’s default spacing between columns.
normal 12px 20px 1.5rem 2rem

👀 Live Preview

Both blocks use column-count: 3. Compare a small gap (0.5rem) with a larger gap (2rem).

column-gap: 0.5rem

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.

column-gap: 2rem

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.

Examples Gallery

Try a 20px gap, compare small vs large gaps, use rem units, and combine gap with column-rule.

↔ Basic Column Gap

Start with the reference example — three columns with a 20px gap.

Example 1 — Three Columns with 20px Gap

Create a multi-column layout with a 20px gap between columns.

column-gap-20px.html
<style>
  .column-layout {
    column-count: 3;
    column-gap: 20px;
  }
</style>

<div class="column-layout">
  <p>Lorem ipsum dolor sit amet...</p>
  <p>Ut enim ad minim veniam...</p>
</div>
Try It Yourself

How It Works

The browser inserts 20 pixels of space between each column while keeping three equal-width column areas.

Example 2 — Small vs Large Column Gap

See how different gap sizes affect readability in the same three-column layout.

column-gap-compare.css
.gap-small {
  column-count: 3;
  column-gap: 8px;
}

.gap-large {
  column-count: 3;
  column-gap: 2.5rem;
}
Try It Yourself

How It Works

Larger gaps make columns easier to scan separately; smaller gaps fit more text width per column.

🛠 Styled Column Layouts

Use relative units and pair column-gap with column-rule for polished layouts.

Example 3 — Column Gap with rem Units

Use rem so gap spacing scales with the root font size.

column-gap-rem.css
.article {
  column-count: 2;
  column-gap: 1.5rem;
  max-width: 40rem;
}
Try It Yourself

How It Works

rem units keep column spacing proportional to your site’s base typography settings.

Example 4 — Column Gap with column-rule

Add a visible divider in the gap between columns for a magazine-style layout.

column-gap-rule.html
<style>
  .magazine {
    column-count: 3;
    column-gap: 1.5rem;
    column-rule: 1px solid #cbd5e1;
  }
</style>

<div class="magazine">...</div>
Try It Yourself

How It Works

column-rule draws a line centered in the gap created by column-gap.

🧠 How column-gap Works

1

Multi-column layout is set

You define columns with column-count or column-width.

Prerequisite
2

You set column-gap

Choose a length like 20px or 1.5rem, or use normal.

CSS rule
3

Browser reserves gap space

Empty space is inserted between column boxes; content does not overlap the gap.

Layout
=

Readable spaced columns

Text columns are separated by clear, adjustable whitespace for better readability.

Modern Browser Support

The column-gap property is supported in most modern browsers, including Chrome, Firefox, Safari, Edge, and Opera.

Baseline · Modern browsers

Column spacing everywhere

Major browsers support column-gap in multi-column layouts and CSS Grid.

97% Modern browser support
Google Chrome 50+ · Desktop & Mobile
Full support
Mozilla Firefox 52+ · Desktop & Mobile
Full support
Apple Safari 9+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 37+ · Modern versions
Full support
column-gap property 97% supported

Bottom line: Use column-gap confidently in multi-column text layouts. Test gap sizes on mobile where columns may collapse to one.

Conclusion

The column-gap property is a useful tool for creating clean and organized multi-column layouts. By adjusting the gap between columns, you can improve the readability and visual appeal of your content.

Experiment with different gap values — from tight 8px spacing to generous 2rem gaps — to find the best layout for your website.

💡 Best Practices

✅ Do

  • Use 1rem to 2rem gaps for readable article columns
  • Pair column-gap with column-count on text containers
  • Use rem for gaps that scale with typography
  • Add column-rule when you want visible dividers
  • Test gap size on different screen widths

❌ Don’t

  • Use zero gap unless columns have strong visual separation elsewhere
  • Make gaps so wide that column text lines become too narrow
  • Confuse multi-column column-gap with Flexbox gap use cases
  • Forget mobile — reduce to one column when space is limited
  • Rely on gap alone when you need a visible border — use column-rule

Key Takeaways

Knowledge Unlocked

Five things to remember about column-gap

Use these points when spacing multi-column layouts.

5
Core concepts
02

normal Default

Browser spacing.

Default
🔢 03

Length values

px, em, rem.

Values
🗃 04

With column-count

Multi-column module.

Context
🛸 05

Readability

Adjust for comfort.

Design

❓ Frequently Asked Questions

column-gap sets the width of the space between columns in a multi-column layout. It adds breathing room so text in adjacent columns does not feel cramped.
The initial value is normal, which lets the browser choose an appropriate default gap between columns.
column-gap specifically controls horizontal spacing between columns in multi-column layout (and column gaps in Grid). The gap shorthand sets both row and column gaps in Flexbox and Grid.
You can use any CSS length value such as px, em, rem, or %. The keyword normal uses the browser default spacing.
Use column-gap with column-count or column-width on multi-column containers. It pairs well with column-rule for visible dividers between columns.

Practice in the Live Editor

Open the HTML editor, add column-count: 3 and column-gap: 20px, and adjust the spacing.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful