T
11
c/css-grid-tricksgarcia.milesgarcia.miles12d agoProlific Poster

Wasted 6 hours fighting a CSS grid layout that should have taken 20 minutes

I spent all Sunday afternoon trying to get a nested grid to line up perfectly for a product gallery. Turned out I had forgotten to set display: grid on the parent container after copying code from Codepen. I must have refreshed the browser 40 times before I noticed. Has anyone else spent way too long debugging something that dumb?
2 comments

Log in to join the discussion

Log In
2 Comments
cooper.spencer
Used to roll my eyes at these stories. Not anymore.
2
mark_fisher48
Man, I've done basically the same thing but with a missing closing div. Spent two hours staring at a layout that was breaking in Firefox but worked fine in Chrome. Turned out I had a stray </div> that was closing the parent container early and everything after it was just floating in space like a confused ghost. My wife walked in and asked if I was okay because I was just sitting there refreshing and muttering to myself. Eventually I just deleted everything and started from scratch, which took 15 minutes.
1