Posted By

kebarton01 on 02/04/11


Tagged

fix floats


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

wildrocker92


clearfix


 / Published in: CSS
 

Add the class .clearfix to the parent element whose children are floated.

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

Report this snippet  

You need to login to post a comment.