grid-gutters-010.html (1137B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Support for percentage values for grid-gap with indefinite percentage basis</title> 4 <link rel="help" href="https://www.w3.org/TR/css-grid-1/#gutters"> 5 <link rel="help" href="https://www.w3.org/TR/css-align-3/#gap-shorthand"> 6 <link rel="match" href="../reference/grid-percentage-gap-ref.html"> 7 <link rel="author" title="Rachel Andrew" href="mailto:me@rachelandrew.co.uk"> 8 <style> 9 #grid { 10 display: grid; 11 width: 200px; 12 grid-gap: 10%; 13 grid-template-columns: 90px 90px; 14 grid-template-rows: 90px 90px; 15 background-color: green; 16 margin-bottom: 30px; 17 } 18 19 #grid > div { 20 background-color: silver; 21 } 22 </style> 23 24 <p>The test passes if it has the same visual effect as reference. Column gap should be percentage of width. Row gap should be percentage of height.</p> 25 <div id="grid"> 26 <div></div> 27 <div></div> 28 <div></div> 29 <div></div> 30 </div> 31 <div id="grid" style="display:inline-grid; width:auto; grid-gap:calc(20px + 5%)"> 32 <div></div> 33 <div></div> 34 <div></div> 35 <div></div> 36 </div>