Created
July 15, 2013 01:30
-
-
Save cerebrl/5996916 to your computer and use it in GitHub Desktop.
CSS Attribute Selectors
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 2.1 Attribute Selectors | |
**************************/ | |
E[foo] /* Matches any E element with the "foo" attribute set (whatever the value). */ | |
E[foo="warning"] /* Matches elements whose "foo" attribute value is exactly equal to "warning".*/ | |
E[foo~="warning"] /* Matches elements whose "foo" attribute value is a list of space-separated values, one of which is exactly equal to "warning". */ | |
/************************** | |
CSS 3 Attribute Selectors | |
**************************/ | |
div[id*=post] /* anything with post */ | |
div[id^=post] /* anything begining with post */ | |
div[id$=post] /* anything ending with post */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment