How to add additional styles to hyperlinks

Example analysis:

● Set different font colors for links in different states.

a.one:link {color:#ff0000;}

a.one:visited {color:#0000ff;}

a.one:hover {color:#ffcc00;}

##● Set different font sizes and colors for links in different states .

a.two:link {color:#ff0000;}

a.two:visited {color:#0000ff;}

a.two:hover {font-size:150%;}

##● Set different background colors for links in different states .

a.three:link {color:#ff0000;}

a.three:visited {background:#0000ff;}

a.three:hover {background:#66ff66;}

● Set different font styles or font colors for links in different states .

a.four:link {color:#ff0000;}

a.four:visited {color:#0000ff;}

a.four:hover {font-family:Georgia, serif;}

● The link displays or removes the underline in different states.

a.five:link {color:#ff0000;text-decoration:none;}

a.five:visited {color: #0000ff;text-decoration:none;}

##a.five:hover {text-decoration:underline;color:coral;}

Continuing Learning
||
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php(php.cn)</title>
<style>
a.one:link {color:#ff0000;}
a.one:visited {color:#0000ff;}
a.one:hover {color:#ffcc00;}
a.two:link {color:#ff0000;}
a.two:visited {color:#0000ff;font-size:50px;}
a.two:hover {color:pink;font-size:150%;}
a.three:link {color:#ff0000;}
a.three:visited {background:#0000ff;}
a.three:hover {background:#66ff66;}
a.four:link {color:#ff0000;}
a.four:visited {color:#0000ff;}
a.four:hover {font-family:Georgia, serif;}
a.five:link {color:#ff0000;text-decoration:none;}
a.five:visited {color:#0000ff;text-decoration:none;}
a.five:hover {text-decoration:underline;color:coral;}
</style>
</head>
<body>
<p>.</p>
<p><b><a class="one" href="#"></a></b></p>
<p><b><a class="two" href="#"></a></b></p>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
submitReset Code
图片放大关闭