Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-sizing/aspect-ratio/flex-aspect-ratio-055.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<meta name="assert" content="
The automatic minimum size makes the flex item be 50px wide (converted from the height through the aspect ratio).
Adding the borders, the flex container is then a 100x100 square.">
<style>
.flex {
display: inline-flex;
border: solid 25px green;
}
.flex img {
height: 50px;
flex: 0 0 0px;
aspect-ratio: 1 / 1;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div class="flex">
<img src="support/20x50-green.png">
</div>