...

/

Part 1: Pseudo-Classes

Part 1: Pseudo-Classes

Learn about CSS pseudo-class selectors.

Pseudo-classes

Pseudo-class selectors are predefined keywords that define the state of an element or target a child element. They occur pretty frequently, and we can see them in action when a colon follows an element. An example of this is the :hover selector:

a:hover {   
   /* Hover is a pseudo-class! */ 
}

Note: The :hover selector selects elements when you mouse over them.

Common pseudo-class selectors

Listed below are some of the most common pseudo-classes grouped into the following categories: state, validation, structural, ...