Created
March 16, 2011 17:20
-
-
Save maylogger/872866 to your computer and use it in GitHub Desktop.
用 scss 寫出一個 ie 也沒問題的 self-clear
This file contains 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
@mixin self-clear { | |
clear: both; | |
&:after { | |
content: "."; | |
display: block; | |
height: 0; | |
clear: both; | |
visibility: hidden; | |
} | |
*:first-child+html & { min-height: 1px; } // hack ie7 | |
* html & { height: 1%; } // hack ie6 | |
} | |
// example: | |
.group, .section, section { | |
@include self-clear; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment