A square ratio reserves equal sides even before media loads. Fit rules decide whether rectangular content is cropped or letterboxed.
Worked example
<style>
.demo {
width: 6rem;
aspect-ratio: 1;
}
</style>
<div class="demo">Square aspect ratio</div>Implementation notes
An image's intrinsic dimensions can affect the preferred ratio. Give the media a defined fitting area when all cards must remain square.
Try it yourself
Put both a portrait photo and a landscape photo in the same square.
Open the CSS example →Editorial date October 27, 2026 · Published December 6, 2026