Created
March 26, 2014 02:20
-
-
Save myfonj/9775795 to your computer and use it in GitHub Desktop.
CSS selector specificity test
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
/* | |
CSS selector specificity test | |
pass trough code and activate/deactivate comments to see it in action | |
*/ | |
/* add or remove space after "*" → */ | |
#Menu:not(#x):not(#x):after { | |
content:'#Menu:not(#x):not(#x) ' !important; | |
} | |
/* equals * / | |
#Menu#Menu#Menu:after { | |
content:'#Menu#Menu#Menu ' !important; | |
} | |
/* > */ | |
#Menu:not(#XXX):after { | |
content:'#Menu:not(#XXX) ' !important; | |
} | |
/* equals * / | |
#Menu#Menu:after { | |
content:'#Menu#Menu ' !important; | |
} | |
/* > */ | |
#Menu:not(.XXX):after { | |
content:'#Menu:not(.XXX) ' !important; | |
} | |
/* equals * / | |
#Menu.some:after { | |
content:'#menu.some' !important; | |
} | |
/* equals * / | |
#Menu[id]:after { | |
content:'#Menu[id]' !important; | |
} | |
/* > */ | |
div#Menu:after { | |
content:'div#Menu' !important; | |
} | |
/* equals */ | |
#Menu:not(XXX):after { | |
content:'#Menu:not(XXX)' !important; | |
} | |
/* > */ | |
#Menu:after { | |
content:'#Menu' !important; | |
} | |
/* */ |
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
<div class="some" id="Menu"></div> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment