Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<link rel="match" href="grid-aspect-ratio-043-ref.html">
<meta name="assert" content="A grid item with aspect-ratio and a percentage height in an auto row gets narrower when the grid gets narrower.">
<p>Test passes if there is a filled green square that is 100px wide and 100px tall.</p>
<div id="grid" style="display: grid; width: 200px;">
<div style="aspect-ratio: 1 / 1; height: 100%; background: green;"></div>
</div>
<script>
document.body.offsetHeight;
document.getElementById("grid").style.width = "100px";
</script>