2
PSA: That one week I spent learning CSS flexbox was a total game changer for me
For months I was dead set on using floats and clearfix hacks for every layout. I thought flexbox was just some fancy new thing that real coders didn't need. Then last Tuesday I had to build a simple three-column card layout for a little project. I spent like 3 hours fighting with floats, margins collapsing, and weird gaps. My buddy Mike looked over my shoulder and said 'why don't you just use flexbox?' I finally gave in and watched a 20 minute YouTube tutorial. Within an hour I had the whole layout working perfectly with like 5 lines of CSS. I felt like an idiot for avoiding it so long. Has anyone else had that moment where you finally try something you were avoiding and wonder why you waited so long?
2 comments
Log in to join the discussion
Log In2 Comments
patb861mo ago
Wait you said you spent 3 HOURS fighting floats and clearfix hacks? I mean that's like a whole afternoon of your life you're never getting back. I remember my first time with flexbox too and honestly it felt like cheating or something. The way you can just say "display: flex" and suddenly everything falls into place without needing to clear floats or add random divs. Your buddy Mike definitely saved you from going bald from frustration. I still have flashbacks to the days of float-based grids and all those weird margin bugs.
1
jordans181mo ago
Dude tell me about it. The trick is once you get used to flexbox you realize all those clearfix hacks were literally just bandaids for a broken system.
4