CSS gap Property Reference
The CSS gap property is a standard property in CSS Box Alignment. Review its formal syntax, computed behavior, and practical declarations.
Updated 2026-08-12
gap overview
The CSS gap property is a standard property in CSS Box Alignment. Review its formal syntax, computed behavior, and practical declarations.
The property is not inherited by default. Use an explicit global keyword when inheritance is intended.
Syntax and formal definition
| Field | Value |
|---|---|
| Formal syntax | <'row-gap'> <'column-gap'>? |
| Initial value | row-gap, column-gap |
| Applies to | multiColumnElementsFlexContainersGridContainers |
| Inherited | No |
| Percentages | no |
| Computed value | row-gap, column-gap |
| Animation type | row-gap, column-gap |
| Media | visual |
| Specification group | CSS Box Alignment |
| Status | Standard |
Practical examples
These declarations demonstrate valid ways to set gap. The initial and inherit global keywords remain available even when a property-specific value is preferable.
CSS
.reset-example {
gap: initial;
}
.inherit-example {
gap: inherit;
}
@supports (gap: 1rem) {
.supported {
gap: 1rem;
}
}