CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

Pseudo Classes in CSS

Pseudo Classes

 

 

The CSS pseudo-classes allow us to style elements, or parts of elements, that exist in the document tree without using JavaScript or any other scripts. A pseudo-class starts with a colon (":"). The most commonly used pseudo-classes are first-child and:last-child. The :first-child pseudo-class will only add style to the first selected element while :last-child will apply the style to the last selected element.

 

A list of pseudo-classes and pseudo-elements are:-

 

  1. :active Selector in CSS
  2. ::after Selector in CSS
  3. ::before Selector in CSS
  4. :checked Selector in CSS
  5. :default Selector in CSS
  6. :disabled Selector in CSS
  7. :empty Selector in CSS
  8. :enabled Selector in CSS
  9. :first-child Selector in CSS
  10. ::first-letter Selector in CSS
  11. ::first-line Selector in CSS
  12. :first-of-type Selector in CSS
  13. :focus Selector in CSS
  14. :fullscreen Selector in CSS
  15. :hover Selector in CSS
  16. :in-range Selector in CSS
  17. :indeterminate Selector in CSS
  18. :invalid Selector in CSS
  19. :lang Selector in CSS
  20. :last-child Selector in CSS
  21. :last-of-type Selector in CSS
  22. :link Selector in CSS
  23. ::marker Selector in CSS
  24. :not Selector in CSS
  25. :nth-child() Selector in CSS
  26. :nth-last-child() Selector in CSS
  27. :nth-last-of-type() Selector in CSS
  28. :nth-of-type() Selector in CSS
  29. :only-of-type Selector in CSS
  30. :only-child Selector in CSS
  31. :optional Selector in CSS
  32. :out-of-range Selector in CSS
  33. ::placeholder Selector in CSS
  34. :read-only Selector in CSS
  35. :read-write Selector in CSS
  36. :required Selector in CSS
  37. :root Selector in CSS
  38. ::selection Selector in CSS
  39. :target Selector in CSS
  40. :valid Selector in CSS
  41. :visited Selector in CSS

Code Explanation

All Tutorials related to CSS3

All Sections related to CSS