Float Clearing should use The New Clearfix #4

Closed
Ry7n opened this Issue May 6, 2011 · 5 comments

Comments

Projects
None yet
5 participants

Ry7n commented May 6, 2011

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.

Owner

taitems commented May 6, 2011

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.

retlehs commented May 6, 2011

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).

exside commented Jun 10, 2011

+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^^)

Owner

taitems commented Jun 11, 2011

Fixed locally, pending commit.

@taitems taitems closed this Jun 11, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment