A square utility reserves stable thumbnail geometry. Pair it with an object-fit decision that preserves the part of the source image you need.
Worked example
<div class="demo w-24 aspect-square">Square aspect ratio</div>Implementation notes
A square wrapper reserves layout space but does not describe the image to screen-reader users. Write alternative text for the content, or leave it empty for decoration.
Try it yourself
Compare a face near the edge of a portrait with a centred product.
Open the Tailwind CSS example →Editorial date August 5, 2025 · Published December 6, 2026