CSS Pseudo-classes

Pseudo-classes apply styles to elements based on their state or position in the document tree. 

Tutorials dojo strip

:Hover

The :hover pseudo-class applies styles when the user hovers over an element.

CSS


:Focus

The :focus pseudo-class applies styles when an element receives focus, such as when a user clicks on an input field.

CSS


:Nth-child(n)

The :nth-child(n) pseudo-class applies styles to the nth child of a parent element

CSS


:First-child

The :first-child pseudo-class applies styles to the first child of a parent element.

CSS




CSS Pseudo-classes Example Code

HTML/CSS




CSS Labs

Tutorials dojo strip