Created
February 27, 2017 16:32
-
-
Save alireza-saberi/387d8e88e7ff7989508c17a547443926 to your computer and use it in GitHub Desktop.
The clearfix allows a container to wrap it's floated children. Without a clearfix or equivalent styling, a container does not wrap around its floated children and collapses, just as if its floated chldren were positioned absolutely.
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
.clearfix:after { | |
content: "."; | |
display: block; | |
height: 0; | |
clear: both; | |
visibility: hidden; | |
} | |
/* CSS rule for IE6 */ | |
* html .clearfix { | |
height: 1%; | |
} | |
/* CSS rule for IE7 */ | |
*:first-child+html .clearfix { | |
min-height: 1px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment