grid-item-no-aspect-ratio-stretch-3.html (1151B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>stretching works for replaced items with no aspect ratio</title> 4 <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> 5 <link rel="author" title="Mozilla" href="https://mozilla.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-grid"> 7 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1656281"> 8 <link rel="match" href="grid-item-no-aspect-ratio-stretch-3-ref.html"> 9 <style> 10 body { 11 line-height: 0; 12 } 13 14 div { 15 display: inline-grid; 16 height: 250px; 17 width: 350px; 18 background: grey; 19 margin: 10px; 20 vertical-align: top; 21 } 22 23 .justify { 24 justify-self: stretch; 25 } 26 .align { 27 align-self: stretch; 28 } 29 </style> 30 <div> 31 <img class="align justify"> 32 </div> 33 <div> 34 <img class="align"> 35 </div> 36 <div> 37 <img class="justify"> 38 </div> 39 <div> 40 <img> 41 </div> 42 43 <script> 44 var url = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="20px"><circle cx="50%" cy="50%" r="50%" fill="blue"/></svg>' 45 var imgs = document.querySelectorAll('img'); 46 for (var i = 0; i < imgs.length; ++i) { 47 var img = imgs[i]; 48 img.src = url; 49 } 50 </script>