/ Published in: CSS
URL: http://perishablepress.com/press/2009/12/06/new-clearfix-hack/
Preferably put the IE6 and IE7 code in designated stylesheets.
Expand |
Embed | Plain Text
/* new clearfix */ .clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } * html .clearfix { zoom: 1; } /* IE6 */ *:first-child+html .clearfix { zoom: 1; } /* IE7 */
Comments
Subscribe to comments
You need to login to post a comment.

You can always clear float's by adding overflow:hidden and width to container. Works in all browsers.
I now use this method:
Contain floats: nicolasgallagher.com/micro-clearfix-hack/