Loading lesson path
Concept visual
Start at both ends
Overview
Formula
A CSS pseudo - class is a keyword that can be added to a selector, to define a style for a special state of an element.Style an element when a user moves the mouse over it
Style an element that is the first child of its parent
Formula
Pseudo - classes are always denoted by a single colon (:) followed by the pseudo - class name:selector:pseudo-class-name {}Formula
Interactive pseudo - classes apply styles based on user interaction:hover - When mouse is over an element :focus - When an element has focus :active - When an element is being activated :link - Unvisited links :visited - Visited links
Formula
Structural pseudo - classes select elements based on their position in the document treeFormula
:first - childFormula
:last - childFormula
:nth - child(n)Formula
For a complete list of all CSS Pseudo - classes, visit our
CSS Pseudo - classes Reference.