CSS · Selectors and cascade

:hover

Styles an element while the pointer is over it. Never put essential information behind hover only.

Syntax
:hover

Example

Try it

Notes

Touch devices may never hover. Pair hover with focus-visible.

More in this group

::after ::before ::placeholder ::selection :active :checked :disabled :empty

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course