Last active
January 4, 2023 04:37
-
-
Save HenryC-3/7ffd38611425b279c56cc3927044d4c6 to your computer and use it in GitHub Desktop.
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
// 现代浏览器clearfix方案, 不支持IE6/7 | |
.clearfix:after { | |
display: table; | |
content: " "; | |
clear: both; | |
} | |
// 全浏览器通用的clearfix方案 | |
// 引入了zoom以支持IE6/7 | |
.clearfix:after { | |
display: table; | |
content: " "; | |
clear: both; | |
} | |
.clearfix { | |
*zoom: 1; | |
} | |
// 全浏览器通用的clearfix方案【推荐】 | |
// 引入了zoom以支持IE6/7 | |
// 同时加入:before以解决现代浏览器上边距折叠的问题 | |
.clearfix:before, | |
.clearfix:after { | |
display: table; | |
content: " "; | |
} | |
.clearfix:after { | |
clear: both; | |
} | |
.clearfix { | |
*zoom: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment