How to specify the background color of a link

Example analysis:

##a:link {background-color:#B2FF99;} /* Unvisited link*/

a:visited {background-color:#FFFF85;} /* Visited link*/

a:hover {background-color:#FF704D; } /* Move the mouse to the link*/

a:active {background-color:#FF704D;} /* When the mouse is clicked*/

Use the background-color attribute to set different background colors in different states of the link.

Continuing Learning
||
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php(php.cn)</title>
<style>
a:link {background-color:#B2FF99;} /* 访 */
a:visited {background-color:#FFFF85;} /* 访 */
a:hover {background-color:#FF704D;} /* */
a:active {background-color:#FF704D;} /* */
</style>
</head>
<body>
<p><b><a href="#"></a></b></p>
<p><b>:</b> hover:link a:visited.</p>
<p><b>:</b>activehover.</p>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
submitReset Code
图片放大关闭