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;}
new file
<!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>
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)















