D
7
c/coding-for-beginnersthe_beththe_beth1mo agoProlific Poster

Spent 3 hours trying to fix a stupid CSS float issue until I tried display: inline-block instead

Seriously I was wrestling with a navigation menu that kept breaking on mobile. Tried clearfix, overflow hidden, even some weird hack I found on Stack Overflow from 2012. Nothing worked. Then my buddy glanced at my screen and said 'just use inline-block bro'. Fixed it in 2 seconds. Now I'm mad I wasted an afternoon on floats. Has anyone else had a moment where the simplest fix made you feel like an idiot for not trying it sooner?
1 comments

Log in to join the discussion

Log In
1 Comment
skylercooper
Yeah but floats were basically the only game in town for layouts back in the day so it's hard to shake that habit. I still catch myself reaching for float:left out of muscle memory even though flexbox is way easier. The worst part is when you finally switch to something simple and realize you could have saved yourself like two hours of frustration if you just asked someone sooner. What was the hardest CSS lesson you had to unlearn?
5