Last active
December 10, 2018 21:09
-
-
Save nathansmith/1260785 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 | |
//-------------------------------------------------- | |
// Can be added to other style rules via: | |
// | |
// #foobar | |
// @extend .clearfix | |
.clearfix:before, | |
.clearfix:after | |
content: "." | |
display: block | |
overflow: hidden | |
visibility: hidden | |
font-size: 0 | |
line-height: 0 | |
width: 0 | |
height: 0 | |
.clearfix:after | |
clear: both | |
.clearfix | |
zoom: 1 |
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
/* | |
In a Sass file, if you type... | |
#foobar | |
@extend .clearfix | |
It will output this CSS... | |
*/ | |
.clearfix:before, | |
.clearfix:after, | |
#foobar:before, | |
#foobar:after { | |
content: "."; | |
display: block; | |
overflow: hidden; | |
visibility: hidden; | |
font-size: 0; | |
line-height: 0; | |
width: 0; | |
height: 0; | |
} | |
.clearfix:after, | |
#foobar:after { | |
clear: both; | |
} | |
.clearfix, | |
#foobar { | |
zoom: 1; | |
} |
Hi, I can not solve the problem Chrome and firefox ... only works in IE (10):
html:
ul class='ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-wudget-header ui-corner-all'
css:
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display:table;
border-collapse: collapse;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm updating this comment thread, because I just found a bug with the
display:table
approach in jQuery UI.Example of the bug:
http://codepen.io/anon/pen/gAfkJ
Example of the fix:
http://codepen.io/anon/pen/KoHGc
Open ticket(fixed in jQuery UI 1.10.0)http://bugs.jqueryui.com/ticket/8442
Granted, this is an edge-case, but it had me debugging for awhile, trying to fix a client's site.
The following code…
Makes the
.ui-helper-clearfix
inherit from browser default…Now, granted everyone usually resets that to…
Still it's worth being sure the bug is fixed, by adding…