row-gap
Flexbox and grid
Sets only the space between rows.
| How to write it | row-gap: 0; |
|---|---|
| Common values | 0, 1rem |
| Inherited | No — it stops at this element |
| Part of | gap |
| Category | Flexbox and grid |
How to read this
- An inherited property only needs writing once on the parent — every child picks it up. Most text properties work this way.
- A shorthand resets whatever you leave out. Writing background: red alone also wipes a background image you set earlier.
- When rules collide, the more specific selector wins; only when specificity ties does source order decide.
- Animate transform and opacity for smoothness. Changing width or top forces the layout to be recalculated.
Frequently asked questions
Q. What is the CSS row-gap property?
Sets only the space between rows.
Q. How do you write row-gap?
As row-gap: 0; Common values include 0, 1rem.
Q. Is row-gap inherited?
No. It applies only where you write it, so each element needs its own declaration.
Q. Which shorthand sets row-gap?
gap can set it in one line.