Skip to content

Instantly share code, notes, and snippets.

@maylogger
Created March 16, 2011 17:20
Show Gist options
  • Save maylogger/872866 to your computer and use it in GitHub Desktop.
Save maylogger/872866 to your computer and use it in GitHub Desktop.
用 scss 寫出一個 ie 也沒問題的 self-clear
@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