6
Had a talk with a junior dev that made me rethink old CSS tricks
I was showing some new guy at work how I used to do those old float-based layouts with clearfix hacks. He just looked at me and said 'why not just use flexbox, it's been around for years.' Hit me hard because I've been doing this since IE6 days and never stopped to check if my old ways still make sense. Now I'm going back through my personal projects and updating all that crusty CSS. Anyone else find themselves clinging to old methods way longer than they should?
3 comments
Log in to join the discussion
Log In3 Comments
sandra14614h ago
Right, and now we’ll all be using grid and wondering why we ever fought with floats.
1
ray21012h ago
My first site was a simple 3-column layout for my buddy's bait shop and I spent a whole weekend fighting floats to get the footer to stay down. Eventually just threw a clearfix on everything and prayed. Switched to grid on a little landing page for a side project and it was done in an hour, no weird collapsing issues. I mean, floats taught me a lot about how browsers actually work, but I don't miss the frustration one bit. Grid just feels like it was designed for humans, not for hacking around box model quirks.
8
charlie_stone7214h ago
Honestly floats were always a hack anyway. Grid just makes sense.
3