What is the use of pseudo-classes in CSS?

Pseudo-classes are used as a popular technique in CSS to change the style of an element when this element changes its state. There are numerous examples of when we can use a pseudo-class:

  • For the style change when the mouse moves over the element
  • For out-of-focus animations
  • For providing styles for external links