by tomcooks · 7y ago · 0 comments
Supported everywhere, keeps markup to the bare minimum and doesn't smell like 1992 <table> based layouts.
Float can have undesirable behaviour regarding document flow and clearing afterwards. I try to use it just for floating things inside of text.
Position is just a bit illogical, really. Especially when playing with absolute. It puts you at the mercy of any parent element that just happens to be position:relative. I try to stay in the document flow whenever possible.
I like flexbox a lot. My biggest complaint is simply that it has a ton of rules and have to frequently look them up. It's a lot nicer to work in for 1D interfaces though. Especially in the age of responsive design.
I haven't had a chance to really dive into grid yet, but from what I've read it looks really useful for 2D layouts. It means not having to rely on the various column-based CSS frameworks for more complex sites. This will probably be my go-to in the future for main site layouts.
In my opinion however Flexbox and Grid have a decent advantage when it comes to responsive/fluid layouts. Grid and Flexbox scale by design while floats and position feel static.
Word of advice: don't even think about viewing the source on this very page. :P