G
4

Wasted 4 hours on a simple CSS layout last night

Was building a basic landing page in my apartment, tried to center a div with flexbox. Kept getting overflow issues, finally figured out I forgot to set the parent container height. How do you guys debug CSS when nothing makes sense?
2 comments

Log in to join the discussion

Log In
2 Comments
ruby_murphy
Used to just throw random properties at it and hope something stuck, but that burned me too many times. Actually started using the browser dev tools to toggle stuff on and off one by one, it's way slower but catches the dumb stuff like missing heights. Now I keep a little checklist in my head for common stuff like parent container size before I start tweaking margins.
1
taylor174
taylor17414d ago
Friend literally smashed his keyboard over this exact thing last week.
1