You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Abstract: This CSS module defines a two-dimensional grid-based layout system, optimized for user interface design. In the grid layout model, the children of a grid container can be positioned into arbitrary slots in a flexible or fixed predefined layout grid.
However, grid items are grid-level boxes, not block-level boxes:
622
-
they participate in their container's <a>grid formatting context</a>,
623
-
not in a block formatting context.
624
-
625
616
<div class="example">
626
617
Examples of grid items:
627
618
<pre>
@@ -648,7 +639,7 @@ Grid Items</h2>
648
639
649
640
Some values of 'display' trigger the generation of anonymous boxes.
650
641
For example, a misparented ''table-cell'' child is fixed up
651
-
by <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">generating anonymous ''table'' and ''table-row'' elements</a> around it. [[!CSS21]]
642
+
by <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">generating anonymous <css>table</css> and <css>table-row</css> elements</a> around it. [[!CSS21]]
652
643
This fixup must occur <em>before</em> a <a>grid container</a>’s children are promoted to <a>grid items</a>.
653
644
For example, given two contiguous child elements with ''display:table-cell'',
654
645
an anonymous table wrapper box around them becomes the <a>grid item</a>.
@@ -657,6 +648,21 @@ Grid Items</h2>
657
648
Future display types may generate anonymous containers (e.g. ruby) or otherwise mangle the box tree (e.g. run-ins).
658
649
It is intended that grid item determination run after these operations.
659
650
651
+
A <a>grid item</a> establishes a new formatting context for its contents.
652
+
The type of this formatting context is determined by its 'display' value, as usual.
is not rendered, as if it were <spanclass="css">display:none</span>.</p>
1716
1716
1717
-
1718
-
<p>A <adata-link-type="dfn" href="#grid-item">grid item</a> establishes a new formatting context for its contents.
1719
-
The type of this formatting context is determined by its <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visuren.html#propdef-display">display</a> value, as usual.
1720
-
The computed <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visuren.html#propdef-display">display</a> of a <adata-link-type="dfn" href="#grid-item">grid item</a>
<p>Some values of <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visuren.html#propdef-display">display</a> trigger the generation of anonymous boxes.
1756
-
For example, a misparented <spanclass="css">table-cell</span> child is fixed up
1746
+
For example, a misparented <aclass="css"data-link-type="maybe" href="http://dev.w3.org/csswg/css-display-3/#valdef-display-outside-table-cell">table-cell</a> child is fixed up
1757
1747
by <ahref="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">generating anonymous <spanclass="css">table</span> and <spanclass="css">table-row</span> elements</a> around it. <adata-biblio-type="normative" data-link-type="biblio" href="#biblio-css21" title="CSS21">[CSS21]</a>
1758
1748
This fixup must occur <em>before</em> a <adata-link-type="dfn" href="#grid-container">grid container</a>’s children are promoted to <adata-link-type="dfn" href="#grid-item">grid items</a>.
1759
1749
For example, given two contiguous child elements with <spanclass="css">display:table-cell</span>,
Future display types may generate anonymous containers (e.g. ruby) or otherwise mangle the box tree (e.g. run-ins).
1765
1755
It is intended that grid item determination run after these operations.
1766
1756
1757
+
</p>
1758
+
<p>A <adata-link-type="dfn" href="#grid-item">grid item</a> establishes a new formatting context for its contents.
1759
+
The type of this formatting context is determined by its <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visuren.html#propdef-display">display</a> value, as usual.
1760
+
The computed <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/visuren.html#propdef-display">display</a> of a <adata-link-type="dfn" href="#grid-item">grid item</a>
However, grid items are grid-level boxes, not block-level boxes:
1764
+
they participate in their container’s <adata-link-type="dfn" href="#grid-formatting-context">grid formatting context</a>,
1765
+
not in a block formatting context.</p>
1766
+
1767
+
1768
+
<p>A <adata-link-type="dfn" href="#grid-item">grid item</a> is sized within the containing block defined by its <adata-link-type="dfn" href="#grid-area">grid area</a>
1769
+
similarly to an equivalent block-level box in an equivalently-sized containing block,
1770
+
except that <spanclass="css" data-link-for="margin">auto</span> margins and the <adata-link-type="dfn" href="http://dev.w3.org/csswg/css-align-3/#box-alignment-properties">box alignment properties</a>
1771
+
have special effects. (See <adata-section="" href="#alignment">§9
<adata-link-type="dfn" href="#grid-item">grid items</a> stretch to fill their <adata-link-type="dfn" href="#grid-area">grid area</a>.
4391
-
However, if <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-justify-self">justify-self</a> or <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-align-self">align-self</a> compute to a value other than <spanclass="css">stretch</span>
4399
+
However, if <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-justify-self">justify-self</a> or <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-align-self">align-self</a> compute to a value other than <aclass="css"data-link-type="maybe" href="http://dev.w3.org/csswg/css-align-3/#valdef-content-distribution-stretch">stretch</a>
4392
4400
or margins are <aclass="css" data-link-for="margin" data-link-type="value">auto</a>,
4393
4401
<adata-link-type="dfn" href="#grid-item">grid items</a> will auto-size to fit their contents.</p>
<p>A <adata-link-type="dfn" href="#grid-item">grid item</a><dfndata-dfn-type="dfn" data-export="" id="baseline-participation">participates in baseline alignment<aclass="self-link" href="#baseline-participation"></a></dfn> in a particular dimension
4540
-
if its value for <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-align-self">align-self</a> or <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-justify-self">justify-self</a>, as appropriate, is <spanclass="css">baseline</span>
4548
+
if its value for <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-align-self">align-self</a> or <aclass="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-align-3/#propdef-justify-self">justify-self</a>, as appropriate, is <aclass="css"data-link-type="maybe" href="http://dev.w3.org/csswg/css-align-3/#valdef-justify-content-justify-self-justify-items-align-content-align-self-align-items-baseline">baseline</a>
4541
4549
and its inline axis is parallel to that dimension.</p>
0 commit comments