Last active
November 23, 2016 12:58
-
-
Save FLasH3r/6916789 to your computer and use it in GitHub Desktop.
clearfix variations (with original source link)
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
/* | |
* source: http://nicolasgallagher.com/micro-clearfix-hack/ | |
*/ | |
.clearfix:before, .clearfix:after { content: " "; display: table; } | |
.clearfix:after { clear: both; } | |
.clearfix { *zoom: 1; } |
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
/* | |
* source: http://perishablepress.com/new-clearfix-hack/ | |
*/ | |
.clearfix:after { | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
content: " "; | |
clear: both; | |
height: 0; | |
} | |
.clearfix { display: inline-table; } | |
/* Hides from IE-mac \*/ | |
* html .clearfix { height: 1%; } | |
.clearfix { display: block; } | |
/* End hide from IE-mac */ |
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
/* | |
* source: http://perishablepress.com/new-clearfix-hack/ | |
*/ | |
.clearfix:after { | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
content: " "; | |
clear: both; | |
height: 0; | |
} | |
* html .clearfix { zoom: 1; } | |
*:first-child+html .clearfix { zoom: 1; } |
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
/* | |
* source: http://nicolasgallagher.com/better-float-containment-in-ie/ | |
*/ | |
.nbfc { | |
overflow: hidden; | |
*zoom: expression(this.runtimeStyle.zoom="1", this.appendChild(document.createElement("br")).style.cssText="clear:both;font:0/0 serif"); | |
*zoom: 1; | |
} |
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
/* | |
* source: http://www.webtoolkit.info/css-clearfix.html | |
*/ | |
.clearfix:after { | |
content: "."; | |
display: block; | |
clear: both; | |
visibility: hidden; | |
line-height: 0; | |
height: 0; | |
} | |
.clearfix { | |
display: inline-block; | |
} | |
html[xmlns] .clearfix { | |
display: block; | |
} | |
* html .clearfix { | |
height: 1%; | |
} |
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
/* | |
* http://davidwalsh.name/css-clear-fix | |
*/ | |
.clearfix:before, .clearfix:after { | |
content: "\0020"; | |
display: block; | |
height: 0; | |
overflow: hidden; | |
} | |
.clearfix:after { | |
clear: both; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment