Posted By

1man on 03/12/11


Tagged

css float clearfix


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jaypplr


CSS Clearfix


 / Published in: CSS
 

CSS clearfix without using overflow: hidden.

  1. .clearfix:after {
  2. visibility: hidden;
  3. display: block;
  4. font-size: 0;
  5. content: " ";
  6. clear: both;
  7. height: 0;
  8. } /* slightly enhanced, universal clearfix hack */
  9. .clearfix {display: inline-block;}
  10. /* start commented backslash hack \*/
  11. * html .clearfix {height: 1%;}
  12. .clearfix {display: block;} /* close commented backslash hack */
  13. .clear {clear:both;}

Report this snippet  

You need to login to post a comment.