Skip to content

Commit eebf7fe

Browse files
committed
[css-grid] Add example of justify/align-content on a grid container.
1 parent 4f5a0b2 commit eebf7fe

2 files changed

Lines changed: 34 additions & 9 deletions

File tree

css-grid/Overview.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,8 +2293,8 @@ <h3 class="heading settled heading" data-level=8.4 id=abspos-items><span class=s
22932293
<img height=402 src=images/abspos-grid.svg width=702>
22942294
</figure>
22952295

2296-
<p class=note> Note: Note that grids and the <a data-link-type=dfn href=#grid-placement-property title="grid-placement properties">grid-placement properties</a> are <a data-link-type=dfn title=flow-relative>flow-relative</a>,
2297-
while abspos offsets are <a data-link-type=dfn title=physical>physical</a>,
2296+
<p class=note> Note: Note that grids and the <a data-link-type=dfn href=#grid-placement-property title="grid-placement properties">grid-placement properties</a> are <a data-link-type=dfn href=http://dev.w3.org/csswg/css-writing-modes-3/#flow-relative title=flow-relative>flow-relative</a>,
2297+
while abspos offsets are <a data-link-type=dfn href=http://dev.w3.org/csswg/css-writing-modes-3/#physical title=physical>physical</a>,
22982298
so if the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-writing-modes-3/#propdef-direction title=direction>direction</a> or <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-writing-modes-3/#propdef-writing-mode title=writing-mode>writing-mode</a> properties change,
22992299
the grid will transform to match,
23002300
but the offsets won’t.
@@ -2393,8 +2393,21 @@ <h3 class="heading settled heading" data-level=9.4 id=grid-align><span class=sec
23932393
(for example, if no columns are flex-sized),
23942394
the <a data-link-type=dfn href=#grid title=grid>grid</a> is aligned within the padding box according to the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-align-3/#justify-content title=justify-content>justify-content</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-align-3/#align-content title=align-content>align-content</a> properties on the <a data-link-type=dfn href=#grid-container title="grid container">grid container</a>.
23952395

2396-
<p class=issue id=issue-ca7aec73><a class=self-link href=#issue-ca7aec73></a>
2397-
Provide a picture as example.
2396+
<div class=example>
2397+
For example, the following grid is centered vertically,
2398+
and aligned to the right edge of its <a data-link-type=dfn href=#grid-container title="grid container">grid container</a>:
2399+
2400+
<pre> .grid {
2401+
display: grid;
2402+
grid: 12rem 12rem 12rem 12rem / 10rem 10rem 10rem 10rem;
2403+
justify-content: end;
2404+
align-content: center;
2405+
}
2406+
</pre>
2407+
<figure>
2408+
<img height=252 src=images/align-justify-content.svg width=352>
2409+
</figure>
2410+
</div>
23982411

23992412
<h3 class="heading settled heading" data-level=9.5 id=z-order><span class=secno>9.5 </span><span class=content>
24002413
Z-axis Ordering: the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#z-index title=z-index>z-index</a> property</span><a class=self-link href=#z-order></a></h3>
@@ -3320,9 +3333,6 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
33203333
instead of always using 1,1 by default.
33213334

33223335
<a href=#issue-4e6cc4f1></a></div><div class=issue>
3323-
Provide a picture as example.
3324-
3325-
<a href=#issue-ca7aec73></a></div><div class=issue>
33263336
Currently this algorithm embodies several heuristics which regulate the growth of spanning <a data-link-type=dfn href=#grid-item title="grid items">Grid items</a> to accommodate certain use cases. (E.g. the game example in Figures 2 and 3 above.) These heuristics should be a normative part of this specification to ensure interoperability. To the extent additional use cases can be identified that cannot be satisfied by following the current heuristics, the normative algorithm can be updated, or additional mechanisms can be introduced for fine-grained control of content-based TrackSizingFunction.
33273337

33283338
<a href=#issue-7a82b645></a></div><div class=issue>

css-grid/Overview.src.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,8 +2448,23 @@ <h3 id='grid-align'>
24482448
(for example, if no columns are flex-sized),
24492449
the <a>grid</a> is aligned within the padding box according to the 'justify-content' and 'align-content' properties on the <a>grid container</a>.
24502450

2451-
<p class='issue'>
2452-
Provide a picture as example.
2451+
<div class='example'>
2452+
For example, the following grid is centered vertically,
2453+
and aligned to the right edge of its <a>grid container</a>:
2454+
2455+
<pre>
2456+
.grid {
2457+
display: grid;
2458+
grid: 12rem 12rem 12rem 12rem / 10rem 10rem 10rem 10rem;
2459+
justify-content: end;
2460+
align-content: center;
2461+
}
2462+
</pre>
2463+
2464+
<figure>
2465+
<img src="images/align-justify-content.svg" width="352" height="252">
2466+
</figure>
2467+
</div>
24532468

24542469
<h3 id='z-order'>
24552470
Z-axis Ordering: the 'z-index' property</h3>

0 commit comments

Comments
 (0)