Posted By

mihael on 01/26/09


Tagged

css clear float clearfix


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

sulfurito
inkdeep
snipplrhanz


Clear floats - cleaner clearfix


 / Published in: CSS
 

Add class \"clear\" to elements that contain floated elements and they will hold the height correctly

  1. /* CLEAR FLOATS
  2. /* Add class "clear" to elements that contain floated elements and they will hold the height correctly
  3. /* updated: 01.10.2010
  4. *******************************************************/
  5. .clear:before,
  6. .clear:after {
  7. content: ".";
  8. display: block;
  9. height: 0;
  10. visibility: hidden;
  11. }
  12. .clear:after {clear: both;}
  13. .clear {zoom: 1;}
  14. /*******************************************************/

Report this snippet  

You need to login to post a comment.