grid-content-distribution-008.html (1761B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Content Distribution 'space-evenly' and gaps on 3x3 grid</title> 4 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-align"> 6 <link rel="help" href="https://drafts.csswg.org/css-align-3/#content-distribution"> 7 <link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-align-content-space-evenly"> 8 <link rel="match" href="../../reference/ref-filled-green-200px-square.html"> 9 <meta name="assert" content="Content Distribution properties with 'space-evenly' value render correcly."> 10 <style> 11 .block { 12 position: absolute; 13 z-index: -1; 14 background: green; 15 width: 200px; 16 height: 200px; 17 } 18 .block > div { 19 position: absolute; 20 background: red; 21 width: 20px; 22 height: 20px; 23 } 24 .grid { 25 z-index: 1; 26 display: grid; 27 width: 200px; 28 height: 200px; 29 grid-template-columns: 20px 20px 20px; 30 grid-template-rows: 20px 20px 20px; 31 grid-row-gap: 10px; 32 grid-column-gap: 10px; 33 align-content: space-evenly; 34 justify-content: space-evenly; 35 } 36 .grid > div { background: green; } 37 </style> 38 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 39 <div class="block"> 40 <div style="top: 30px; left: 90px;"></div> 41 <div style="top: 30px; left: 150px;"></div> 42 <div style="top: 90px; left: 30px;"></div> 43 <div style="top: 150px; left: 30px;"></div> 44 </div> 45 <div class="grid"> 46 <div class="item" style="grid-row: 1; grid-column: 2;"></div> 47 <div class="item" style="grid-row: 1; grid-column: 3;"></div> 48 <div class="item" style="grid-row: 2; grid-column: 1;"></div> 49 <div class="item" style="grid-row: 3; grid-column: 1;"></div> 50 </div>