CSS gridgap Property (original) (raw)
CSS grid-gap Property
Last Updated : 8 Dec, 2025
The grid-gap property sets the size of the gap between rows and columns in a grid layout, allowing you to easily control the spacing between grid items in both horizontal and vertical directions.
It is a shorthand property for the following properties:
- grid-column-gap property
- grid-row-gap property
**Syntax:
grid-gap: grid-row-gap grid-column-gap;
Property Values:
- grid-row-gap: Sets the size of the gap between the rows in a grid layout. The default value is 0
- grid-column-gap: Sets the size of the gap between the columns in a grid layout. The default value is 0.
Different Examples of CSS Grid Gap Property
**Example 1: In this example, we are using the CSS grid-gap property to give a gap between the row and columns.
html `
CSS grid-gap Property