O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

:hover

Applies to:

An element that is in a hovered state

Description:

This applies to an element during the period in which it is being hovered (when the user is designating an element without activating it). The most common example of this is moving the mouse pointer inside the boundaries of a hyperlink in an HTML document. Other elements can in theory be hovered, although CSS doesn’t define which ones.

Examples:

a[href]:hover {text-decoration: underline;}
p:hover {background: yellow;}

Note:

:hover support in Internet Explorer applies only to hyperlinks in versions previous to IE7.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required