Skip to content

Instantly share code, notes, and snippets.

@hemanth
Created May 25, 2013 09:25
Show Gist options
  • Save hemanth/5648499 to your computer and use it in GitHub Desktop.
Save hemanth/5648499 to your computer and use it in GitHub Desktop.
CSS : must know selectors.
1. *
2. #X
3. .X
4. X Y
5. X
6. X:visited and X:link
7. X + Y
8. X > Y
9. X ~ Y
10. X[title]
11. X[href="foo"]
12. X[href*="nettuts"]
13. X[href^="http"]
14. X[href$=".jpg"]
15. X[data-*="foo"]
16. X[foo~="bar"]
17. X:checked
18. X:after
19. X:hover
20. X:not(selector)
21. X::pseudoElement
22. X:nth-child(n)
23. X:nth-last-child(n)
24. X:nth-of-type(n)
25. X:nth-last-of-type(n)
26. X:first-child
27. X:last-child
28. X:only-child
29. X:only-of-type
30. X:first-of-type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment