We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Ballyhoo


Posted By

masaya on 07/18/06


Tagged

css hack ie float boxmodel clearfix


Versions (?)


Who likes this?

22 people have marked this snippet as a favorite

jonhenshaw
designerd
alvaroisorna
fatihturan
kyokutyo
markfavazza
markhope
horizens
visualAesthetic
basicmagic
tavo
icarus
manub
fael
maid450
rich13
LeeRJohnson
vali29
aziz
blueshome
visuallyspun
vbert


ClearFix


Published in: CSS 


  1. .ClearFix:after{
  2. content:".";
  3. display:block;
  4. height:0;
  5. clear:both;
  6. visibility:hidden;
  7. }
  8.  
  9. /* WinIE7 only */
  10. *:first-child+html .ClearFix{
  11. height:1%;
  12. }
  13.  
  14. /* WinIE6 and below */
  15. /*¥*/
  16. * html .ClearFix{
  17. height:1%;
  18. }
  19. /**/
  20.  
  21. /* MacIE only */
  22. /*¥*//*/
  23. .ClearFix{
  24. display:inline-table;
  25. }
  26. /**/

Report this snippet 

You need to login to post a comment.