CSS row-gap Property
Example
Specify a 50 pixels gap between the grid rows:
div
{
display: grid;
row-gap: 50px;
}
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The row-gap
property specifies the gap between the
grid rows.
The row-gap
property was formerly known as
grid-row-gap
.
Default value: | normal |
---|---|
Inherited: | no |
Animatable: | yes. Read about animatable Try it |
Version: | CSS Box Alignment Module Level 3 |
JavaScript syntax: | object.style.rowGap="50px" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
row-gap (in Grid) | 66 | 16 | 61 | 12 | 53 |
row-gap (in Flexbox) | 84 | 84 | 63 | 14.1 | 70 |
CSS Syntax
row-gap: length|normal|initial|inherit;
Property Values
Value | Description | Demo |
---|---|---|
length | A specified length or % that will set the gap between the rows | Demo ❯ |
normal | Default value. Specifies a normal gap between the rows | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS tutorial: CSS Grid Layout
CSS reference: The gap property
CSS reference: The column-gap property