Posted By

kcmr on 09/12/08


Tagged

css clearfix hasLayout


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

esquareda
alvaroisorna
shilguhn


Another way to clear floating elements (FF, IE 6, IE 7, IE 8 Beta)


 / Published in: CSS
 

URL: http://uninstallme.com/limpiar-flotaciones-otro-metodo-mas/

This method uses the "min-height" property to give "hasLayout" in IE 7, "height" property for IE 6 and the pseudo-element ":after" and "content" property for Gecko based and IE 8 Beta.

  1. .clearfix:after{content: ""; display: block; clear: both; height: 0; visibility: hidden;}
  2. .clearfix{min-height: 0; height: 0;}
  3. html>body .clearfix{height: auto;}

Report this snippet  

You need to login to post a comment.