Created
November 18, 2014 15:38
-
-
Save XOP/4f9f5fc0e824bd43a814 to your computer and use it in GitHub Desktop.
funky yet useful css 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
// | |
// SCSS for convenience | |
// | |
// self sibling | |
// usage: basically margins and other layout specifics | |
.element + .element { | |
} | |
// | |
// frowned child | |
// usage: targeting very first child in a flow | |
.container >:first-child { | |
} | |
// | |
// meta-type | |
// usage: targeting prefix/postfix elements, e.g. .element-alpha, .element-beta, ... | |
[class^="element-"] { | |
} | |
// more examples on the way |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment