@@ -2036,186 +2036,23 @@ Default Alignment Shorthand: the 'place-items' property</h3>
20362036<h2 id='gaps'>
20372037Gaps Between Boxes</h2>
20382038
2039- While 'margin' and 'padding' can be used to specify visual spacing around individual boxes,
2040- it's sometimes more convenient to globally specify spacing
2041- <em> between</em> adjacent boxes within a given layout context,
2042- particularly when the spacing is different between sibling boxes
2043- as opposed to between the first/last box and the container's edge.
2044-
2045- The 'gap' property,
2046- and its 'row-gap' and 'column-gap' sub-properties,
2047- provide this functionality for
2048- <a href="http://www.w3.org/TR/css3-multicol/">multi-column</a> ,
2049- <a href="http://www.w3.org/TR/css-flexbox/">flex</a> ,
2050- and <a href="http://www.w3.org/TR/css-grid/">grid layout</a> .
2051-
2052- <h3 id='column-row-gap'>
2053- Row and Column Gutters: the 'row-gap' and 'column-gap' properties</h3>
2054-
2055- <pre class='propdef'>
2056- Name : row-gap, column-gap
2057- Value : normal | <<length-percentage [0,∞]>> | <<line-width>>
2058- Initial : normal
2059- Applies to : <a>multi-column containers</a>, <a>flex containers</a>, <a>grid containers</a>
2060- Inherited : no
2061- Percentages : see [[#gap-percent]]
2062- Computed value : specified keyword, else a computed <<length-percentage>> value
2063- Animation type : by computed value type
2064- </pre>
2065-
2066- These properties specify fixed-length <dfn export lt="gutter">gutters</dfn>
2067- between items in the container,
2068- adding space between them--
2069- in a manner similar to the ''justify-content/space-between'' keyword
2070- of the <a>content-distribution properties</a> ,
2071- but of a fixed size instead of as a fraction of remaining space.
2072- The 'column-gap' property specifies spacing between “columns”,
2073- separating boxes in the container's <a>inline axis</a>
2074- similar to <a>inline-axis</a> margin;
2075- while 'row-gap' indicates spacing between “rows”,
2076- separating boxes in the container's <a>block axis</a> .
2077-
2078- Values have the following meanings:
2079-
2080- <dl dfn-type=value dfn-for="row-gap, column-gap, gap">
2081- : <<length-percentage [0,∞]>>
2082- : <<line-width>>
2083- ::
2084- Specifies a gap between “rows” or “columns”,
2085- as defined by the layout modes to which it applies;
2086- see subsections below for details.
2087-
2088- Negative values are invalid.
2089- For percentages,
2090- see [[#gap-percent]] .
2091-
2092- : <dfn>normal</dfn>
2093- :: The value ''gap/normal'' represents
2094- a used value of ''1em'' on <a>multi-column containers</a> ,
2095- and a used value of ''0px'' in all other contexts.
2096- </dl>
2097-
2098- Gutters effect a minimum spacing between items:
2099- additional spacing may be added by 'justify-content' /'align-content' .
2100- Such additional space effectively increases the size of these <a>gutters</a> .
2101-
2102- The exact handling of these properties varies by layout container:
2103-
2104- <dl>
2105- <dt id="gap-multicol"> <a>multi-column containers</a>
2106- <dd>
2107- 'column-gap' specifies the [=gutter=] between adjacent <a>column boxes</a> ,
2108- see [[CSS-MULTICOL-1]] .
2109- 'row-gap' specifies the [=gutter=] between the rows of [=column boxes=] established by 'column-height' ,
2110- see [[CSS-MULTICOL-2]] .
2111-
2112- <dt id="gap-flex"> <a>flex containers</a>
2113- <dd>
2114- When applied to the <a>main axis</a>
2115- (e.g. 'column-gap' in a ''flex-flow/row'' <a>flex container</a> ),
2116- indicates the [=gutter=] between items
2117- (as if an additional fixed-size margin were inserted
2118- between adjacent <a>flex items</a>
2119- in a single line).
2120-
2121- When applied to the <a>cross axis</a>
2122- (e.g. 'row-gap' in a ''flex-flow/row'' <a>flex container</a> ),
2123- indicates the [=gutter=] between adjacent <a>flex lines</a> .
2124-
2125- <dt id="gap-grid"> <a>grid containers</a>
2126- <dd>
2127- The 'row-gap' and 'column-gap' properties,
2128- when specified on a <a>grid container</a> ,
2129- define the [=gutters=] between <a>grid rows</a> and <a>grid columns</a> ,
2130- respectively.
2131- See [[css-grid-1#gutters]] for precise details.
2132- </dl>
2133-
2134- In all cases, the [=gutter=] disappears when it coincides with
2135- a [=fragmentation break=] . [[CSS-BREAK-3]]
2136-
2137- Note: Table boxes do not use the 'gap' properties
2138- to specify separation between their cells.
2139- Instead, they use the 'border-spacing' property,
2140- which has slightly different functionality:
2141- it inherits,
2142- and it also specifies the additional spacing between the outermost cells
2143- and the border of the table
2144- (similar to ''space-evenly'' rather than ''space-between'' ).
2145-
2146- <h3 id='gap-shorthand'>
2147- Gap Shorthand: the 'gap' property</h3>
2148-
2149- <pre class='propdef'>
2150- Name : gap
2151- Value : <<'row-gap'>> <<'column-gap'>>?
2152- Initial : see individual properties
2153- Applies to : <a>multi-column containers</a>, <a>flex containers</a>, <a>grid containers</a>
2154- Inherited : no
2155- Percentages : refer to corresponding dimension of the content area
2156- Computed value : see individual properties
2157- Animation type : by computed value type
2158- </pre>
2159-
2160- This property is a <a>shorthand</a> that sets 'row-gap' and 'column-gap' in one declaration.
2161- If <<'column-gap'>> is omitted,
2162- it's set to the same value as <<'row-gap'>> .
2163-
2164- <div class='example'>
2165- <figure>
2166- <img src="images/gutters-gaps.svg" alt="A diagram showing how margins and padding add to the visible gutter size" width="500" height="616">
2167- </figure>
2168-
2169- Note: The 'gap' property is only one component of the visible “gutter” or “alley” created between boxes.
2170- Margins, padding, or the use of distributed alignment
2171- may increase the visible separation between boxes
2172- beyond what is specified in 'gap' .
2173- </div>
2174-
2175- <h3 id='gap-percent'>
2176- Percentages In 'gap' Properties</h3>
2177-
2178- In general,
2179- gaps introduced by the 'gap' properties
2180- are intended to act like an empty item/track/etc
2181- with the gap's size;
2182- in other words,
2183- an author should be able to reproduce the effects of 'gap'
2184- by just inserting additional empty items/tracks/etc
2185- into the container.
2186-
2187- 'gap' always resolves percentages against
2188- the corresponding size of the [=content box=]
2189- of the element.
2190- When this size is definite,
2191- the behavior is well-defined
2192- and consistent across layout modes.
2193- But since different layout modes treat [=cyclic percentage sizes=] for items/tracks/etc differently,
2194- 'gap' does as well:
2195-
2196- : In Grid Layout
2197- ::
2198- <a href="https://www.w3.org/TR/css-sizing-3/#percentage-sizing">As in the min size properties and margins/paddings</a> [[CSS-SIZING-3]] ,
2199- [=cyclic percentage sizes=] resolve against zero
2200- for determining intrinsic size contributions,
2201- but resolve against the box’s content box
2202- when laying out the box’s contents.
2203-
2204- : In Flex Layout
2205- ::
2206- [=Cyclic percentage sizes=] resolve against zero in all cases.
2207-
2208- <h3 id='gap-legacy'>
2209- Legacy Gap Properties: the 'grid-row-gap', 'grid-column-gap', and 'grid-gap' properties</h3>
2210-
2211- The Grid Layout module was originally written with its own set of [=gutter=] properties,
2212- before all such properties were unified into the existing 'row-gap' /'column-gap' naming.
2213- For compatibility with legacy content,
2214- these grid-prefixed names must be supported as follows:
2215-
2216- * <dfn property>grid-row-gap</dfn> as a [=legacy name alias=] of the 'row-gap' property
2217- * <dfn property>grid-column-gap</dfn> as a [=legacy name alias=] of the 'column-gap' property
2218- * <dfn property>grid-gap</dfn> as a [=legacy name alias=] of the 'gap' property
2039+ <span id="column-row-gap"></span>
2040+ <span id="propdef-row-gap"></span>
2041+ <span id="propdef-column-gap"></span>
2042+ <span id="gutter"></span>
2043+ <span id="valdef-row-gap-normal"></span>
2044+ <span id="gap-multicol"></span>
2045+ <span id="gap-flex"></span>
2046+ <span id="gap-grid"></span>
2047+ <span id="gap-shorthand"></span>
2048+ <span id="propdef-gap"></span>
2049+ <span id="example-06510943"></span>
2050+ <span id="gap-percent"></span>
2051+ <span id="gap-legacy"></span>
2052+ <span id="propdef-grid-row-gap"></span>
2053+ <span id="propdef-grid-column-gap"></span>
2054+ <span id="propdef-grid-gap"></span>
2055+ This section has been moved to [[CSS-GAPS-1#gaps]] .
22192056
22202057<!--
22212058████████ ███ ██████ ████████ ██ ████ ██ ██ ████████
0 commit comments