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
Track Sizing: the <aclass=propertydata-link-type=propdeschref=#propdef-grid-template-rowstitle=grid-template-rows>grid-template-rows</a> and <aclass=propertydata-link-type=propdeschref=#propdef-grid-template-columnstitle=grid-template-columns>grid-template-columns</a> properties</span><aclass=self-linkhref=#track-sizing></a></h3>
851
851
852
-
<tableclass="definition propdef"><tr><th>Name:<td><dfnclass=css-codedata-dfn-type=propertydata-export="" id=propdef-grid-template-columns>grid-template-columns<aclass=self-linkhref=#propdef-grid-template-columns></a></dfn>, <dfnclass=css-codedata-dfn-type=propertydata-export="" id=propdef-grid-template-rows>grid-template-rows<aclass=self-linkhref=#propdef-grid-template-rows></a></dfn><tr><th>Value:<td>none | <aclass="production css-code" data-link-type=typehref=#typedef-track-listtitle="<track-list>"><track-list></a> | subgrid <aclass="production css-code" data-link-type=typehref=#typedef-line-name-listtitle="<line-name-list>"><line-name-list></a>?<tr><th>Initial:<td>none<tr><th>Applies to:<td><adata-link-type=dfnhref=#grid-containertitle="grid containers">grid containers</a><tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>As specified, except for <aclass=css-codedata-link-for=grid-template-columnsdata-link-type=valuehref=#valuedef-autotitle=auto>auto</a> (see prose), with lengths made absolute<tr><th>Percentages:<td>see prose</table>
852
+
<tableclass="definition propdef"><tr><th>Name:<td><dfnclass=css-codedata-dfn-type=propertydata-export="" id=propdef-grid-template-columns>grid-template-columns<aclass=self-linkhref=#propdef-grid-template-columns></a></dfn>, <dfnclass=css-codedata-dfn-type=propertydata-export="" id=propdef-grid-template-rows>grid-template-rows<aclass=self-linkhref=#propdef-grid-template-rows></a></dfn><tr><th>Value:<td>none | <aclass="production css-code" data-link-type=typehref=#typedef-track-listtitle="<track-list>"><track-list></a> | subgrid <aclass="production css-code" data-link-type=typehref=#typedef-line-name-listtitle="<line-name-list>"><line-name-list></a>?<tr><th>Initial:<td>none<tr><th>Applies to:<td><adata-link-type=dfnhref=#grid-containertitle="grid containers">grid containers</a><tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>As specified, except for <aclass=cssdata-link-for=grid-template-columnsdata-link-type=maybehref=#valuedef-autotitle=auto>auto</a> (see prose), with lengths made absolute<tr><th>Percentages:<td>see prose</table>
853
853
<p>
854
854
These properties specify,
855
855
as a space-separated <dfndata-dfn-type=dfndata-export="" id=track-list>track list<aclass=self-linkhref=#track-list></a></dfn>,
Rather than specifying the sizes of rows/columns explicitly,
927
927
they’ll be taken from the parent grid’s definition.
928
928
If the <adata-link-type=dfnhref=#grid-containertitle="grid container">grid container</a> is not a <adata-link-type=dfnhref=#grid-itemtitle="grid item">grid item</a>,
929
-
this value computes to <aclass=css-codedata-link-for=grid-template-rowsdata-link-type=valuehref=#valuedef-none0title=none>none</a>.
929
+
this value computes to <aclass=cssdata-link-for=grid-template-rowsdata-link-type=maybehref=#valuedef-none0title=none>none</a>.
930
930
See the <ahref=#subgrids>Subgrids</a> section for more detail.
Automatic Placement: the <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-flowtitle=grid-auto-flow>grid-auto-flow</a> property</span><aclass=self-linkhref=#grid-auto-flow-property></a></h3>
<adata-link-type=dfnhref=#grid-itemtitle="grid items">Grid items</a> that aren’t explicitly placed are automatically placed into an unoccupied space in the <adata-link-type=dfnhref=#grid-containertitle="grid container">grid container</a>.
1530
1530
The <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-flowtitle=grid-auto-flow>grid-auto-flow</a> property controls the direction in which the search for unoccupied space takes place,
auto-placed <adata-link-type=dfnhref=#grid-itemtitle="grid items">grid items</a> are simply positioned according to the <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-positiontitle=grid-auto-position>grid-auto-position</a> property.
Win8 compat might require the <aclass=css-codedata-link-for=grid-auto-flowdata-link-type=valuehref=#valuedef-nonetitle=none>none</a> value to stay the initial value,
Win8 compat might require the <aclass=cssdata-link-for=grid-auto-flowdata-link-type=maybehref=#valuedef-nonetitle=none>none</a> value to stay the initial value,
1565
1565
but it’s not a very good value,
1566
1566
because by default the entire contents of a grid container will end up stacked on top of each other.
1567
1567
See <ahref=http://lists.w3.org/Archives/Public/www-archive/2013Aug/0024.html>proposals to address this</a>
In the following example, there are three columns, each auto-sized to their contents.
1576
1576
No rows are explicitly defined.
1577
-
The <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-flowtitle=grid-auto-flow>grid-auto-flow</a> property is <aclass=css-codedata-link-for=grid-auto-flowdata-link-type=valuehref=#valuedef-rowstitle=rows>rows</a>
1577
+
The <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-flowtitle=grid-auto-flow>grid-auto-flow</a> property is <aclass=cssdata-link-for=grid-auto-flowdata-link-type=maybehref=#valuedef-rowtitle=row>row</a>
1578
1578
which instructs the grid to search across its three columns starting with the first row,
1579
1579
then the next,
1580
1580
adding rows as needed until sufficient space is located to accommodate the position of any auto-placed <adata-link-type=dfnhref=#grid-itemtitle="grid item">grid item</a>.
<p> The following <dfndata-dfn-type=dfndata-export="" id=auto-placementtitle="auto-placement|auto-placement algorithm">auto-placement algorithm<aclass=self-linkhref=#auto-placement></a></dfn> places <adata-link-type=dfnhref=#grid-itemtitle="grid items">grid items</a> with <adata-link-type=dfnhref=#automatic-grid-positiontitle="automatic grid positions">automatic grid positions</a> into a <adata-link-type=dfnhref=#definite-grid-positiontitle="definite grid position">definite grid position</a>.
1668
1668
1669
1669
<p> To aid in clarity,
1670
-
this algorithm is written with the assumption that <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-flowtitle=grid-auto-flow>grid-auto-flow</a> is set to <aclass=css-codedata-link-for=grid-auto-flowdata-link-type=valuehref=#valuedef-rowstitle=rows>rows</a>.
1671
-
If it is instead set to <aclass=css-codedata-link-for=grid-auto-flowdata-link-type=valuehref=#valuedef-columnstitle=columns>columns</a>,
1670
+
this algorithm is written with the assumption that <aclass=propertydata-link-type=propdeschref=#propdef-grid-auto-flowtitle=grid-auto-flow>grid-auto-flow</a> is set to <aclass=cssdata-link-for=grid-auto-flowdata-link-type=maybehref=#valuedef-rowtitle=row>row</a>.
1671
+
If it is instead set to <aclass=cssdata-link-for=grid-auto-flowdata-link-type=maybehref=#valuedef-columntitle=column>column</a>,
1672
1672
swap all mentions of rows and columns in this algorithm.
Win8 compat might require the <aclass=css-codedata-link-for=grid-auto-flowdata-link-type=valuehref=#valuedef-nonetitle=none>none</a> value to stay the initial value,
3330
+
Win8 compat might require the <aclass=cssdata-link-for=grid-auto-flowdata-link-type=maybehref=#valuedef-nonetitle=none>none</a> value to stay the initial value,
3331
3331
but it’s not a very good value,
3332
3332
because by default the entire contents of a grid container will end up stacked on top of each other.
3333
3333
See <ahref=http://lists.w3.org/Archives/Public/www-archive/2013Aug/0024.html>proposals to address this</a>
0 commit comments