Flexbox Masonry Layout (Explained with Math)
Flexbox has a very specific algorithm for determining how to deal with remaining (or lack of) space in a row. Let’s use actual math to understand it then apply it to a masonry layout.
Flexbox has a very specific algorithm for determining how to deal with remaining (or lack of) space in a row. Let’s use actual math to understand it then apply it to a masonry layout.
The other day I needed to quickly see pixel dimensions that were exactly in a 9 / 16 aspect ratio. Like: 180 / 320. That’s perfectly in that ratio. You might be able to think of that one in your head, but how about 351 / 624? That’s harder to think of. And I wanted […]
CSS has an aspect-ratio property, which has had full support since around 2021. It can be a very satisfying property to use, because it can help match how your brain 🧠works or what the desired design outcome does better than forcing dimensions does. “I need a square here” or “I need to match the […]
Frontend Masters donates to open source projects through thanks.dev and Open Collective, as well as donates to non-profits like The Last Mile, Annie Canons, and Vets Who Code.