Created
November 15, 2010 14:05
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @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; } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/**
tablerather thanblockis only necessary if using:beforeto contain the top-margins of child elements.@mixin clearfix.*/
.cf:before,
.cf:after {
content: " ";
display: table;
}
.cf:after {
clear: both;
}