CSS Tutorial
CSS Link Tutorial
Learn How To Add Styles to Links
The following CSS code examples shows you how to add styles to links with CSS.
<html>
<head>
<style type="text/css">
a.one:link {color: #ff0000}
a.one:visited {color: #0000ff}
a.one:hover {color: #ff0000}
a.two:link {color: #ff0000}
a.two:visited {color: #0000ff}
a.two:hover {font-size: 150%}
a.three:link {color: #ff0000}
a.three:visited {color: #0000ff}
a.three:hover {background: #00ff00}
a.four:link {color: #ff0000}
a.four:visited {color: #0000ff}
a.four:hover {font-family: monospace}
a.five:link {color: #ff0000; text-decoration: none}
a.five:visited {color: #0000ff; text-decoration: none}
a.five:hover {text-decoration: underline}
</style>
</head>
<body>
<p>
<a class="one" href="csshtmltutorial-csslinktutorial.php" target="_blank">This link changes color</a>
</p>
<p>
<a class="two" href="csshtmltutorial-csslinktutorial.php" target="_blank">This link changes font-size</a>
</p>
<p>
<a class="three" href="csshtmltutorial-csslinktutorial.php" target="_blank">This link changes background-color</a>
</p>
<p>
<a class="four" href="csshtmltutorial-csslinktutorial.php" target="_blank">This link changes font-family</a>
</p>
<p>
<a class="five" href="csshtmltutorial-csslinktutorial.php" target="_blank">This link changes text-decoration</a>
</p>
</body>
</html>
The above CSS code examples produce the following CSS link examples.
This link changes background-color
This link changes text-decoration
Try it yourself.

