Is CSS float deprecated?

As a perennial CSS newbie (who kind of had skills a decade ago) I appreciated this short article from Robin Rendle about when (translation: how little) you should use the float: left that was so common when I last really did CSS.

To summarize, you can (and should) keep using float for what it is originally designed for: embedding small things like images inside of text which flows naturally around them. But all the other layout used people put them to for years? Skip it and that annoying clearfix stuff we all had to do.

The most interesting thing from the article—which Robin also seemed surprised by—is that haven’t actually need to do that clearfix stuff for a while, all because of a little property on display called flow-root. To learn just how that works, you’ll have to click through 🤓


Add a Comment

Your email address will not be published. Required fields are marked *