CSS hover Selector (:hover)

What is CSS :hover Selector?

CSS :hover selector occur when user perform mouse hover action over element.
Now a day CSS :hover selector support not only <a> element but also support all other element.

Syntax

General syntax of CSS :hover selector,

:hover {
  property: value;
  property: value;
  ...
}

a:hover {
  property: value;
  property: value;
  ...
}

Example

CSS :hover selector occur when user mouse hover action perform over element.

<!DOCTYPE html>
<html>
<head>
  <title>CSS :hover Selector</title>
  <style type="text/css">
    a:hover {
       color: orange;
    }
  </style>
</head>
<body>
  <a href="#">First</a>
</body>
</html>

Run it...   »

Browser Compatibility

  • Google Chrome 2+
  • Mozilla Firefox 1+
  • Internet Explorer 7+
  • Opera 7+
  • Safari 1.3+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.