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