Little Web Hut
(Cascading Style Sheets) CSS 2.1 Reference

CSS Pseudo-class :hover Selector

 

What is a CSS Pseudo-class :hover Selector?

  • The :hover pseudo-class selector specifies elements when a mouse cursor (or other pointing device) hovers over the element. In the following example, the color property will be set to red for any <p> element that currently has a mouse cursor hovering over it.
CSS Example:
  p:hover {color: red;}
  <p>The red style is applied when the mouse cursor hovers over this element.</p>
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style