Joined February 2013
·

Tony Phipps

Norwich, UK
·
·
·

Posted to Best Clearfix Ever over 1 year ago

This is very similar to the clearfix in the HTML5 Boilerplate, I think this must be from one of the older version. The latest one currently looks like this

.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}

It can be found here with a better explanation: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css

@kkreft Thanks for the link, that does break the it up a bit!

Achievements
84 Karma
3,480 Total ProTip Views