grid-item-minmax-img-001.html (941B)
1 <!DOCTYPE html> 2 <!-- Any copyright is dedicated to the Public Domain. 3 - https://creativecommons.org/publicdomain/zero/1.0/ --> 4 <meta charset="utf-8"> 5 <title>Image within a grid with a size that depends on the containing block should stretch, but not size the grid tracks</title> 6 <link rel="author" href="mailto:emcdonough@mozilla.com"> 7 <link rel="help" href="https://drafts.csswg.org/css-grid-2/#algo-stretch"> 8 <link rel="help" href="https://drafts.csswg.org/css-grid-2/#algo-single-span-items"> 9 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 10 <style> 11 #grid { 12 display: inline-grid; 13 grid-template-columns: minmax(auto, 0); 14 grid-template-rows: minmax(auto, 0); 15 width: 200px; 16 } 17 </style> 18 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 19 <div id="grid"> 20 <img id="img" src="support/100x100-green.png"> 21 <div style="background-color: red; aspect-ratio: 1;"> 22 </div>