(hover) background-color: ***;

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

The background-color property specifies the background color of an element.

When you set this property with pseudo-classes for the A element, the background color of the link can be changed according to the state of the link.

In the following examples, the background color is changed only when you mouse over the link.


a:hover {
background-color: gray;
}

Property Value Explanation
background-color color code or name the color of the background

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

a:hover { background-color: #ffd78c; }

</style>

</head>
<body>

<p><a href="index.html">Link Styles</a></p>

</body>
</html>

Output

Link Styles