GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
The problem with using overflow: hidden to clear floats is that in addition to clearing floats, it also hides overflow. So if you've got a heading that's supposed to hang just outside of your box, you've got a tough choice to make.
The New Clearfix method is a great way to clear floats in modern browsers, and falls back in IE the same way that the overflow trick does.
Not sure how I feel about browser specific CSS hacks, as that's what I set out to avoid, but I will definitely mention this.
more recent (last week) and now used by html5 boilerplate: http://nicolasgallagher.com/micro-clearfix-hack/
I don't see the point of using a bunch of code to clearfix when I can use overflow. IF I come to a situation where I can't use overflow, I'll use clearfix. But like most people, I prefer simple code over multi-line code (though mine is still not as large as the one at perishable press... 4 lines tops).
+1 for the .clearfix, works great and for practical use I have switched to only use this one (mixed the overflow: hidden and .clearfix techniques before, and if you have to refactor the code a year later or so, it's a pain in the a** because you've forgotten where you used the overflow thing and where not^^)
Fixed locally, pending commit.