CSS Tutorial

CSS Style

CSS Layout Style

CSS Float Style

CSS Reference

CSS hover Selector (:hover)


What is :hover Selector?

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

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.

Syntax

General syntax of :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.

<style type="text/css">
    a:hover{
        color: orange;
    }
</style>
</head>
<body>
    <a href="#">First</a><br />
</body>

Run it...   »

Example Result: