CSS grid-gap


The CSS grid-gap property is now an alias for the gap property.

Use gap instead.

The remainder of this article outlines how this property worked before it was repurposed as an alias to gap.

Note that this was done in a backwards compatible way, so any legacy code shouldn't be impacted (i.e. any existing grid-gap code should remain working as expected).

The CSS grid-gap property is a shorthand property for setting the gutters between grid rows and columns.

If your browser supports CSS grids, the above example should look like this:

Screenshot of a grid with it's grid-gap set.

The grid-gap property is shorthand for the grid-column-gap and grid-row-gap properties. It's a convenient way to set the grid gutters, without having to write out each property name individually.

Here's how the grid the above example works.

So providing one value sets the gutter for both the rows and the columns.

If you provide two values, the first value sets the gutter for the rows, the second value sets it for the columns.

Like this:


Here's the official syntax of the grid-gap property:

These values are explained below.

Possible Values

This value sets the grid-row-gap property.
This value sets the grid-column-gap property.

Providing only one value applies the same gutter to both the row and the column. Negative values are invalid.


Represents the value specified as the property's initial value.
Represents the computed value of the property on the element's parent.

Basic Property Information

Initial Value
0 0
Applies To
Grid containers
Animation type
As length, percentage, or calc (see example)

CSS Specifications

Browser Support


Vendor Prefixes




