Skip to content

Instantly share code, notes, and snippets.

@jensgro
Created November 15, 2010 14:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jensgro/700385 to your computer and use it in GitHub Desktop.
Save jensgro/700385 to your computer and use it in GitHub Desktop.
Dank des Clearfixes umfassen Container floatende Kindelemente. Alternative ist overflow: hidden, die aber nicht immer gut funktioniert.
/**
* @section Clearing Methoden
* @see http://www.yaml.de/de/dokumentation/grundlagen/allgemeines.html
*/
.clearfix:after {
clear:both;
content:".";
display:block;
font-size:0;
height:0;
visibility:hidden;
}
/* benötigt Safari zwingend */
.clearfix { display:block; }
/* IE6 + 7: hasLayout aktivieren */
.clearfix { *height:1%; }
/* Wenn ich doch mal traditionell clearen will */
.clearing { clear: both; line-height: 0px; font-size: 1px; height: 0px; }
@jensgro
Copy link
Author

jensgro commented Aug 18, 2020

/**

.cf:before,
.cf:after {
content: " ";
display: table;
}

.cf:after {
clear: both;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment