How to add addi...LOGIN

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;}

Next Section
<!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> <p><b><a class="three" href="#">这个链接改变背景颜色</a></b></p> <p><b><a class="four" href="#">这个链接改变字体类型</a></b></p> <p><b><a class="five" href="#">这个链接改变文字修饰</a></b></p> </body> </html>
submitReset Code
ChapterCourseware