@@ -709,6 +709,56 @@ Static Position of Grid Container Children</h3>
709709 the absolutely-positioned child has no effect on the size of the containing block
710710 or layout of its contents.
711711
712+ <h3 id='z-order'>
713+ Z-axis Ordering: the 'z-index' property</h3>
714+
715+ <a>Grid items</a> can overlap when they are positioned into intersecting <a>grid areas</a> ,
716+ or even when positioned in non-intersecting areas because of negative margins or positioning.
717+ The painting order of <a>grid items</a> is exactly the same as inline blocks [CSS21] ,
718+ except that <a>order-modified document order</a> is used in place of raw document order,
719+ and 'z-index' values other than <a value for=z-index>auto</a> create a stacking context even if 'position' is ''static'' .
720+ Thus the 'z-index' property can easily be used to control the z-axis order of grid items.
721+
722+ <p class='note'>
723+ Note: Descendants that are positioned outside a grid item still participate in any stacking context established by the grid item.
724+
725+ <div class="example">
726+ The following diagram shows several overlapping grid items,
727+ with a combination of implicit source order
728+ and explicit 'z-index'
729+ used to control their stacking order.
730+
731+ <figure>
732+ <img src="images/drawing-order.png" />
733+
734+ <figcaption> Drawing order controlled by z-index and source order.</figcaption>
735+ </figure>
736+
737+ <pre>
738+ <style type="text/css">
739+ #grid {
740+ display: grid;
741+ grid-template-columns: 1fr 1fr;
742+ grid-template-rows: 1fr 1fr
743+ }
744+ #A { grid-column: 1 / span 2; grid-row: 2; align-self: end; }
745+ #B { grid-column: 1; grid-row: 1; z-index: 10; }
746+ #C { grid-column: 2; grid-row: 1; align-self: start; margin-left: -20px; }
747+ #D { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; }
748+ #E { grid-column: 1 / span 2; grid-row: 1 / span 2;
749+ z-index: 5; justify-self: center; align-self: center; }
750+ </style>
751+
752+ <div id="grid">
753+ <div id="A">A</div>
754+ <div id="B">B</div>
755+ <div id="C">C</div>
756+ <div id="D">D</div>
757+ <div id="E">E</div>
758+ </div>
759+ </pre>
760+ </div>
761+
712762<h2 id='grid-definition'>
713763The Explicit Grid</h2>
714764
@@ -2514,56 +2564,6 @@ Aligning the Grid: the 'justify-content' and 'align-content' properties</h3>
25142564 </figure>
25152565 </div>
25162566
2517- <h3 id='z-order'>
2518- Z-axis Ordering: the 'z-index' property</h3>
2519-
2520- <a>Grid items</a> can overlap when they are positioned into intersecting <a>grid areas</a> ,
2521- or even when positioned in non-intersecting areas because of negative margins or positioning.
2522- The painting order of <a>grid items</a> is exactly the same as inline blocks [CSS21] ,
2523- except that <a>order-modified document order</a> is used in place of raw document order,
2524- and 'z-index' values other than <a value for=z-index>auto</a> create a stacking context even if 'position' is ''static'' .
2525- Thus the 'z-index' property can easily be used to control the z-axis order of grid items.
2526-
2527- <p class='note'>
2528- Note: Descendants that are positioned outside a grid item still participate in any stacking context established by the grid item.
2529-
2530- <div class="example">
2531- The following diagram shows several overlapping grid items,
2532- with a combination of implicit source order
2533- and explicit 'z-index'
2534- used to control their stacking order.
2535-
2536- <figure>
2537- <img src="images/drawing-order.png" />
2538-
2539- <figcaption> Drawing order controlled by z-index and source order.</figcaption>
2540- </figure>
2541-
2542- <pre>
2543- <style type="text/css">
2544- #grid {
2545- display: grid;
2546- grid-template-columns: 1fr 1fr;
2547- grid-template-rows: 1fr 1fr
2548- }
2549- #A { grid-column: 1 / span 2; grid-row: 2; align-self: end; }
2550- #B { grid-column: 1; grid-row: 1; z-index: 10; }
2551- #C { grid-column: 2; grid-row: 1; align-self: start; margin-left: -20px; }
2552- #D { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; }
2553- #E { grid-column: 1 / span 2; grid-row: 1 / span 2;
2554- z-index: 5; justify-self: center; align-self: center; }
2555- </style>
2556-
2557- <div id="grid">
2558- <div id="A">A</div>
2559- <div id="B">B</div>
2560- <div id="C">C</div>
2561- <div id="D">D</div>
2562- <div id="E">E</div>
2563- </div>
2564- </pre>
2565- </div>
2566-
25672567<h3 id='grid-baselines'>
25682568Grid Baselines</h3>
25692569
0 commit comments