R
27

Why nobody talks about how long CSS layout actually takes to figure out

I spent 4 hours trying to center a div inside another div using flexbox, and it turned out I forgot to set a height on the parent. Has anyone else gotten stuck on something this basic for way longer than they expected?
2 comments

Log in to join the discussion

Log In
2 Comments
henderson.mason
henderson.mason6d agoTop Commenter
I had a friend who spent like two whole days trying to get a footer to stick to the bottom of a page. He tried every flexbox trick in the book but the footer kept floating up halfway. Turns out he was wrapping everything in a div that had no height set either, so the browser just collapsed it. He sent me a screenshot of his code and I spotted it in about ten seconds. He was pretty mad but also relieved someone finally saw the problem.
3
kelly.parker
Set the height or use min-height.
2