CKTIS / CSS
CSS property `row-gap`
The `row-gap` property reserves a minimum gutter between adjacent rows or lines: in `grid` it acts on the block axis, in `flex` its meaning depends on direction and line wrapping, and in `multicol` it separates rows of column boxes established by column-height.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
normal | <length-percentage [0,∞]> | <line-width>The row-gap property reserves a minimum gutter between adjacent rows or lines: in grid it acts on the block axis, in flex its meaning depends on direction and line wrapping, and in multicol it separates rows of column boxes established by column-height.
The example compares a grid with row-gap:12px against normal; the second row starts at 32 versus 20, and the container heights are 52 versus 40.
Grammar: normal | <length-percentage [0,∞]> | <line-width>.
The normal value has a used value of 1em in multicolumn layout but 0px in other contexts. Negative gaps are invalid, cyclic percentages have special intrinsic-sizing rules, and align-content or margins can make the visible separation larger than this specified minimum.
Examples
<!doctype html><meta charset="utf-8"><style>html,body{margin:0}.grid{display:grid;grid-template-rows:20px 20px;width:60px;position:absolute;top:0}.grid i{display:block}#spaced{left:0;row-gap:12px}#normal{left:100px;row-gap:normal}</style><div id="spaced" class="grid"><i></i><i id="spacedSecond"></i></div><div id="normal" class="grid"><i></i><i id="normalSecond"></i></div><pre id="result"></pre><script>const delta=(g,e)=>Math.round(e.getBoundingClientRect().top-g.getBoundingClientRect().top),a=delta(spaced,spacedSecond),b=delta(normal,normalSecond),ha=Math.round(spaced.getBoundingClientRect().height),hb=Math.round(normal.getBoundingClientRect().height),x=getComputedStyle(spaced).rowGap,y=getComputedStyle(normal).rowGap;if(a!==32||b!==20||ha!==52||hb!==40||x!=='12px'||y!=='normal')throw new Error('row-gap mismatch '+[a,b,ha,hb,x,y]);result.textContent='second='+a+'/'+b+'; height='+ha+'/'+hb+'; computed='+x+'/'+y;</script>Result
second=32/20; height=52/40; computed=12px/normal
The example compares a grid with `row-gap:12px` against `normal`; the second row starts at 32 versus 20, and the container heights are 52 versus 40.