CSS Link Color Sample Code

Here is the CSS required to change the color of a link in HTML. If you are trying to figure out how to use CSS to change link color, this is the code you’ll need. This can be used either inside the HTML of your page, or in a separate CSS file.

<style type="text/css">
a:link {
 color: #0000ff;
}
a:visited {
 color: #00ff00;
}
a:hover {
 color: #ff0000;
 text-decoration: none;
}
a:active {
 color: #777777;
}
</style>