T
20

Honestly, I spent way too long deciding between grid-auto-flow: dense and a media query for my gallery

Tbh, I was building this image grid for a local bakery in Austin and had 15 photos of different sizes. I tried using `grid-auto-flow: dense` first to fill the gaps, but it kept putting a picture of a croissant next to a wedding cake in a weird order. So I switched to a simple `@media (min-width: 768px)` query to just change the column count, and it was way cleaner. Has anyone else had to pick between these two for a messy layout?
2 comments

Log in to join the discussion

Log In
2 Comments
averymitchell
Totally get that, dense can make a real mess with the visual flow. Had the same fight last month with a portfolio site, where it kept stacking all the portrait shots together and left this huge blank space. Ended up using a couple of clean media queries too, just for column counts at different breakpoints. It felt like more code at first, but honestly it gave me way more control over how things lined up. Sometimes the simpler fix is just better.
3
the_terry
the_terry3d ago
But all that extra code just makes future changes a total pain.
7