Skip to content

Instantly share code, notes, and snippets.

@XOP
Created November 18, 2014 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XOP/4f9f5fc0e824bd43a814 to your computer and use it in GitHub Desktop.
Save XOP/4f9f5fc0e824bd43a814 to your computer and use it in GitHub Desktop.
funky yet useful css selectors
//
// 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