Open this example in the interactive library
Source code
<style>
.demo {
width: 6rem;
aspect-ratio: 1;
}
</style>
<div class="demo">Square aspect ratio</div>
Square aspect ratio with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
.demo {
width: 6rem;
aspect-ratio: 1;
}
</style>
<div class="demo">Square aspect ratio</div>