How to reserve a square icon placeholder in a fluid grid
Answer in brief
Use aspect-ratio on a wrapper whose width comes from the grid. A preferred ratio gives the browser a height before a preview arrives.
Hold the gallery cells steady
Give each thumbnail wrapper aspect-ratio: 1 / 1 and let the column set its width. Fit the image inside it and delay a few responses. The second row should stay in place while the first fills.
Avoid stretching the placeholder
A square wrapper can grow taller if a caption shares its box and adds intrinsic height. Put the illustration in its own ratio-controlled wrapper and the caption below it. With a narrow column and a three-line caption, the thumbnail should remain square while the card grows vertically.
Sources
- [1] aspect-ratio CSS property - CSS — MDN Web Docs, accessed November 23, 2026
Frequently asked questions
Why is my square rule being ignored?
Check whether both width and height are already fixed. A preferred aspect ratio influences automatic sizing.