Floats are bad...Except when they aren't

Yes, the waters are bit muddy on this one. For years, web developers pretty much used float for EVERYTHING. Well, for everything layout that is. Sure, you started to see some inline-block creeping in, nevertheless, floats dominated for a long long time. But recently the proper CSS tools and browser support for non-hacky layout have been available. Specifically, we are talking Flexbox and CSS Grid Layout. So now it almost feels like you shouldn’t float anything, again, ever. Float now has the rep of being bad and old school!

However, once you get over your post-traumatic float layout issues, you come to realise floats in themselves are not evil or bad — IF they are used for what they were supposed to be used for in the first place, things like an image floating to the left with the text flowing around it.

Float is not the “f” word. There is a place in modern web dev for floats.

So remember, in this time, this glorious time where web developers finally are starting to have the key tools to produce complex layouts without hacks (and most of the old evil browsers that didn’t support new things, Eye-E!!!, are gone), try to forget the past and remember you can use floats………… Just not for your layout!

© 2024 Creative Logic Tech Solutions.