Grid system showing gaps

I've been trying to figure out how to make a responsive grid, with some elements spanning 2 tiles, but I've been running into the issue that there are gaps showing up next to the spanning elements. Is there a good way to fix this? Any tips would be greatly appreciated! Here's the Codepen: https://codepen.io/aldouss/pen/yLZZZPa
No description
6 Replies
Islandstone
Islandstone14mo ago
That is happening because you have gap: 1rem on the grid.
clevermissfox
clevermissfox14mo ago
You can try using "dense" to fill in the gaps so if there are elements that will fit, they will fill in the empty cells
Anurag Gupta
Anurag Gupta14mo ago
Remove grid-gap and you will get the desired result
clevermissfox
clevermissfox14mo ago
I dont think they are talking about the grid-gap but filling in empty cells when items are spanning two cells. But we shall find out!
MarkBoots
MarkBoots14mo ago
yep, grid-auto-flow: dense; will do the trick
Jomu
JomuOP14mo ago
Perfect! grid-auto-flow: dense worked, thank you everyone for the support!

Did you find this page helpful?