grid-z-axis-ordering-004.html (1051B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: 'z-index' property controls the z-axis order of grid items</title> 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> 5 <link rel="help" href="http://www.w3.org/TR/css-grid-1/#z-order" title="4.4. Z-axis Ordering: the z-index property"> 6 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 7 <meta name="flags" content="ahem"> 8 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 9 <style> 10 #grid { 11 display: grid; 12 font: 100px/1 Ahem; 13 } 14 15 #test-item-overlapping-green { 16 color: green; 17 z-index: -5; 18 } 19 20 #reference-item-overlapped-red { 21 color: red; 22 z-index: -10; 23 } 24 25 .first-row-first-column { 26 grid-area: 1 / 1; 27 } 28 </style> 29 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 30 31 <div id="grid"> 32 <div id="test-item-overlapping-green" class="first-row-first-column">G</div> 33 <div id="reference-item-overlapped-red" class="first-row-first-column">R</div> 34 </div>