Posted By

mariusscheel on 03/02/10


Tagged

clear float


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jexton


Clearfix:After


 / Published in: CSS
 

URL: http://www.positioniseverything.net/easyclearing.html

  1. <style type="text/css">
  2.  
  3. .clearfix:after {
  4. content: ".";
  5. display: block;
  6. height: 0;
  7. clear: both;
  8. visibility: hidden;
  9. }
  10.  
  11. .clearfix {display: inline-block;} /* for IE/Mac */
  12.  
  13. </style><!-- main stylesheet ends, CC with new stylesheet below... -->
  14.  
  15. <!--[if IE]>
  16. <style type="text/css">
  17. .clearfix {
  18. zoom: 1; /* triggers hasLayout */
  19. display: block; /* resets display for IE/Win */
  20. } /* Only IE can see inside the conditional comment
  21.   and read this CSS rule. Don't ever use a normal HTML
  22.   comment inside the CC or it will close prematurely. */
  23. </style>
  24. <![endif]-->

Report this snippet  

You need to login to post a comment.