CSS grid-column-gap Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The grid-column-gap property sets the size of the gutter between columns in a CSS grid. Space appears only between columns — not on the outer edges of the grid.

For new CSS, prefer column-gap. Pair with grid-template-columns on a display: grid container. Use gap when you need both row and column gutters.

Deprecated name · Legacy alias.

grid-column-gap is a legacy alias of column-gap. It still works in browsers; write column-gap in new code. Baseline Widely available.

CSS Syntax

syntax.css
grid-column-gap: normal | <length-percentage> | initial | inherit;

Same grammar as column-gap. Negative values are invalid. On grid, normal means no column gutter (0).

Property Values

ValueDescriptionTry it
<length> (px)Fixed gutter, e.g. 20pxTry it
<length> (rem)Root-relative gutter, e.g. 1remTry it
<percentage>Percent of the grid content box inline sizeTry it
normalDefault; 0 on grid containersTry it
0No space between columnsTry it
inheritUses the parent’s column gapTry it

How to Use grid-column-gap

Build a grid, then set the column gutter. Prefer column-gap for new stylesheets.

  1. Create a grid with display: grid and grid-template-columns.
  2. Set grid-column-gap (or better, column-gap) to a length or percentage.
  3. Add more than one column so the gutter is visible.
  4. Use grid-row-gap / row-gap or gap for vertical spacing.
PieceRequired?Role
display: gridYesMakes a grid formatting context
Two or more columnsYes (to see a gap)From grid-template-columns
Gap sizeYesLength, percentage, or normal
Modern aliasRecommendedWrite column-gap in new CSS

Live Preview

A three-column grid. Change only grid-column-gap. Row spacing stays fixed.

Gutters appear between columns only. Outer edges stay flush with the grid box.

Grid

grid-column-gap: 20px

CSS Examples

Each snippet focuses on grid-column-gap. Prefer column-gap in production. Use Try It Yourself for a live editor.

Example 1 — Pixel Gap

Add a fixed 20px gutter between three equal columns.

CSS
<style>
  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-column-gap: 20px;
  }
</style>

<div class="grid">
  <div>1</div><div>2</div><div>3</div>
</div>
Try It Yourself

How It Works

  1. Make a grid. display: grid enables grid layout.
  2. Define columns. Three 1fr tracks share the width equally.
  3. Set the gutter. grid-column-gap: 20px inserts 20px between columns.
  4. Modern twin. column-gap: 20px does the same job with the current name.

Example 2 — rem Gap

Scale the column gutter with the root font size.

CSS
<style>
  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-column-gap: 1rem;
  }
</style>

<div class="grid">
  <div>A</div><div>B</div><div>C</div>
</div>
Try It Yourself

How It Works

  1. Keep the same grid. Three columns again so the gap is obvious.
  2. Use rem. 1rem ties the gutter to the root font size (often 16px).
  3. Why rem helps. User or theme font scaling also widens or narrows the gutter.
  4. Still an alias. Writing column-gap: 1rem is preferred in new CSS.

Example 3 — Percentage Gap

Size the gutter relative to the grid’s content box width.

CSS
<style>
  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-column-gap: 10%;
  }
</style>

<div class="grid">
  <div>1</div><div>2</div><div>3</div>
</div>
Try It Yourself

How It Works

  1. Percent of the grid. 10% is relative to the content box inline size.
  2. Wider container, wider gap. Resize the grid and the gutters scale.
  3. Tracks shrink a bit. Gap space is reserved between columns, so 1fr tracks share what remains.
  4. No outer padding. Percentage gutters still do not pad the left/right edges.

Edge Cases & Pitfalls

If the gutter looks wrong, check these first.

legacy

Prefer column-gap in new CSS

grid-column-gap still works as an alias. Teach and write column-gap going forward.

edges

No gap on the outer sides

Gutters only sit between columns. Use padding or margin on the container if you need outer inset.

columns

One column means no visible gap

With a single column track, there is nowhere for a column gutter to appear. Add at least two columns.

shorthand

gap can overwrite column spacing

Writing gap after grid-column-gap resets both axes. Put the more specific rule last, or include both sizes in gap.

negative

Negative values are invalid

A negative length is ignored. Use 0 or a positive length/percentage only.

Browser Support

grid-column-gap is a browser CSS property (legacy alias of column-gap). Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

grid-column-gap

Supported everywhere modern Grid works as an alias of column-gap. Prefer column-gap in new stylesheets.

97% Modern browser support
Google Chrome 57+
Full support
Mozilla Firefox 52+
Full support
Apple Safari 10.1+
Full support
Microsoft Edge 16+
Full support
Opera 44+
Full support
Samsung Internet 6+
Full support
Internet Explorer No (use prefixes / polyfills)
Not supported
grid-column-gap Widely supported (alias)

Bottom line: Safe on modern browsers. Use column-gap for new code; keep grid-column-gap only when maintaining older Grid CSS. It is not a runtime API.

Key Takeaways

  • Role: horizontal gutter between grid columns.
  • Legacy alias: same as column-gap — prefer that name now.
  • Between tracks only: never pads the outer left/right edges.
  • Default on grid: normal → no column gap.

One line: grid + grid-column-gap: 20px; (or column-gap) = space between columns only.

Frequently Asked Questions

It sets the horizontal gutter between columns in a grid. It is a legacy name alias for column-gap and behaves the same way.
Yes as a preferred name. Use column-gap in new CSS. grid-column-gap remains a supported legacy alias so older code keeps working.
For grid and flex, normal computes to 0 (no gap). In multi-column layout, normal is 1em. Gaps never apply to the outer edges of the container.
grid-column-gap (or column-gap) sets only the column gutter. gap is the shorthand for both row-gap and column-gap.
No. Gutters sit only between tracks, not between the first/last track and the container edge.
It is Baseline Widely available as an alias of column-gap. Modern Chrome, Edge, Firefox, Safari, and Opera support it. Prefer column-gap for new work. It is a browser CSS property, not a Node.js feature.

Next: grid-column-start

Place an item by choosing which column line it starts on.

grid-column-start tutorial →

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.

8 people found this page helpful