Short answer
A gutter in web design is the space between columns, and CSS sets it with gap. MDN calls gap the shorthand for gutters on grid, flex, and multi-column layout. The initial value normal is 1em for multi-column layout and 0 for grid and flex. Margin and padding are different boxes. No single pixel size is required.
Last verified against the sources listed below.
Key takeaways
- MDN defines gap as the gutters between rows and columns.
- One gap value sets both row-gap and column-gap. Two values set row, then column.
- normal is 1em in multi-column layout and 0 in grid and flexbox.
- Grid gutters sit only between tracks, not before the first or after the last.
- Margin and padding can make the visible gap larger than the gap value.
What is a gutter in web design is a question about the empty band between columns. In CSS, that band is a gap. MDN says the gap shorthand sets the gaps, also called gutters, between rows and columns on multi-column, flex, and grid containers.
It is not the padding inside a card.
Web design is the larger job of arranging those columns.
What CSS is used for covers the language that sets the gap.
A CSS grid generator can set the tracks and the gap together so you can see the gutter before you copy the declaration.
What is a gutter?
A gutter is the space between columns or rows, not inside them. The CSS gaps draft says a column gap is the gutter between adjacent column boxes, and a row gap is the gutter between rows. On a grid, row gap and column gap are the gutters between grid rows and grid columns.
web.dev’s grid lesson uses the same idea in fewer words. A gap is “a gutter or alley between tracks.” For sizing, it acts like a track. You cannot place content into a gap, but a grid item can span across it.
The gaps draft says these properties set fixed-length gutters. That is different from space-between, which shares leftover space as a fraction. A fixed gutter stays the size you set, even when the container has extra room.
Alignment can still add space on top of that fixed size.
How does CSS gap work?
gap is a shorthand for row-gap and column-gap. One value sets both. Two values set row-gap first and column-gap second.
MDN says the property is not inherited. It applies to multi-column elements, flex containers, and grid containers.
The initial value is normal. MDN says normal is 1em in multi-column layout and 0 everywhere else, including grid and flex. column-gap repeats that split.
Negative values are invalid. A length, a percentage, or a line-width keyword such as thin, medium, or thick is allowed.
Percentages resolve against the content box of the container when that size is definite. MDN’s grid notes say a cyclic percentage can count as zero while the browser figures the intrinsic size, then resolve against the content box when the grid is laid out. If you need a gutter that does not depend on the container, use a length.
MDN marks column-gap as widely available since July 2015, and the gap shorthand as widely available since October 2017. Older stylesheets may say grid-gap or grid-column-gap. Both names remain aliases.
The CSS grid grid shorthand sets tracks and placement, and the spec says it does not reset gutter properties.
Where does the gutter sit?
On a grid, the gutter is only between tracks. CSS Grid says row-gap and column-gap make the affected grid lines act as if they had thickness. For track sizing, each gutter is an extra empty fixed-size track.
An item that spans a line also spans that gutter.
There is no gutter before the first track or after the last track. If the grid breaks across fragments, the gutter between those fragments is suppressed. The spec notes that this differs from margins, which are not suppressed the same way after a forced break.
A collapsed track collapses its gutters too.
justify-content and align-content can insert more space between tracks. The grid spec says that extra space increases the effective gutter. The gaps draft says the same thing in a note: margin, padding, or distributed alignment may increase the visible separation beyond the gap value.
If the measured space looks larger than your declaration, check those three before you change gap.
MDN gives a sizing example. With gap: 10px on a 3 by 3 grid of 100px boxes, an item that spans two columns is 210px wide, because the span includes one 10px gutter. An item that spans all three is 320px wide.
That 10px is the example’s gap, not a required size.
How do margin and padding differ?
Margin, padding, and gap separate different edges. The box model gives every element a content edge, a padding edge, a border edge, and a margin edge. Padding is inside the border.
Margin is outside the border and separates the element from its neighbors. Adjacent vertical margins can collapse, so the margin area is then shared.
Gap does not live inside one element’s box. It is space the container inserts between its columns, rows, flex items, or flex lines. On a row flex container, the gaps draft compares a column gap to a fixed margin inserted between adjacent items.
The comparison is about the visual result. The property is still gap, and it does not collapse the way vertical margins can.
A card with 16px of padding and a grid with 16px of gap will not look the same. The padding is inside every card, including the outer edge of the first and last card. The gap is only between cards.
Outer inset, if you want it, belongs on the container’s padding.
| Term | What it separates |
|---|---|
| Padding | Content from the element’s own border, inside the box |
| Margin | The border edge from neighboring elements, outside the box |
| Gap (gutter) | Rows, columns, flex items, or flex lines inside a container |
| Alignment space | Extra room from justify-content or align-content, added between tracks |
Multi-column text is the case where the default is not zero. column-gap: normal is 1em there. A grid or flex container with no gap declaration has no gutter until you set one.
Do not copy a 20px example from a tutorial and call it the default.
What mistakes are easy to make?
Treating a demo value as a rule is the common miss. The grid spec’s illustration uses four 250px columns and 10px gutter columns. web.dev uses gap: 10px in a lesson.
MDN’s syntax samples include 20px. None of those pages say every site must use that number. Pick a length that matches the type size and the layout, then check it at the widths you care about.
Another miss is expecting gap to pad the outer edge. It will not. Designers then add margin on each child, and the visible band becomes gap plus margin.
MDN warns that the visible space can exceed the gap value for that reason. Put outer space on the container if the gutter itself is already correct.
A third miss is assuming normal means the same thing everywhere. On a multi-column article, normal is 1em. On a grid of cards, normal is 0.
If a new grid looks tight, the missing declaration is gap, not a browser bug. Set both axes on purpose when the row gutter and the column gutter should differ, and remember the order is row, then column. ---
Frequently asked questions
Is a gutter the same thing as padding?
No. The CSS box model puts padding between the content edge and the border edge, inside the element. Margin is the empty area outside the border that separates the element from its neighbors. MDN's gap page says gap creates the gutter between rows and columns, and that margin, padding, and alignment can add still more visible space. Padding stays inside one box. A gutter sits between boxes.
What is the standard gutter size in pixels?
There is no standard pixel gutter in the specs opened for this guide. MDN's examples use values such as 20px, 5px, and 40px to show the syntax. The CSS grid spec shows an example of 250px columns with 10px gutter tracks. web.dev's grid lesson uses gap: 10px in an example. Those are demonstrations. The initial value is normal, which is 0 on a grid.
Does gap add space before the first column?
No. CSS Grid says gutters appear only between tracks. There is no gutter before the first track or after the last track. If a track collapses, its gutters collapse with it. A fragmented grid also suppresses the gutter between the fragments, which is different from margins. If you need space at the outer edge, that space is padding or margin on the container, not gap.
Can flexbox have a gutter?
Yes. MDN says gap sets the space between flex items and between flex lines. For a row, the first value is the gap between lines and the second is the gap between items. The CSS gaps draft says a column gap on a row flex container acts like a fixed margin inserted between adjacent items. The initial value is still normal, which computes to 0 for flex, not to 1em.
Is grid-gap still valid CSS?
Browsers still accept it as an alias. MDN says early grid specs called the shorthand grid-gap, and browsers keep that name so older sites work. column-gap similarly replaced grid-column-gap, which remains an alias. New CSS can use gap, row-gap, and column-gap. The grid shorthand that sets template rows and columns does not reset the gutter properties.
Sources
- gap CSS property · MDN, 2026
- column-gap CSS property · MDN, 2026
- Introduction to the CSS box model · MDN, 2026
- CSS Grid Layout Module Level 1 · W3C, 2026
- CSS Gap Decorations Module Level 1 · CSS Working Group, 2026
- Grid layout · web.dev, 2026