Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Float Clearing should use The New Clearfix #4

Closed
RCanine opened this Issue · 5 comments

5 participants

@RCanine

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.

@taitems
Owner

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

more recent (last week) and now used by html5 boilerplate: http://nicolasgallagher.com/micro-clearfix-hack/

@StommePoes

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

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

@taitems
Owner

Fixed locally, pending commit.

@taitems taitems closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.