This is a printer friendly version of How To Change Hyperlink Color.
If you need to change colors on one page only, this code can be used. It can become a big job if you use this code to create many pages, then discover that you need to change the color again.
If you intend to build many web pages, it is suggested to create an external style sheet and link your HTML documents to that. This way, if you need to change colors again, all you have to do is change the values to just one file - the external style sheet, and changes will take effect across an unlimited number of pages.
Add the following CSS code into the head section of your HTML document: <head>code</head> and change the color values as required:
Code
<style type="text/css">
a:link {
COLOR: #0000FF;
}
a:visited {
COLOR: #800080;
}
a:hover {
COLOR: #FF0000;
}
a:active {
COLOR: #00FF00;
}
</style>
Using an external Style Sheet offers much more flexibility when changing the appearance of HTML documents because an entire web site with thousands of pages can be changed just by changing one single file.
Add the following CSS code to your style sheet and change the color values as required:
Code
a:link {
COLOR: #0000FF;
}
a:visited {
COLOR: #800080;
}
a:hover {
COLOR: #FF0000;
}
a:active {
COLOR: #00FF00;
}
The Style attribute can be added to many HTML Tags. Below is an example of how to add the style attribute to an Anchor Tag in order to change the color of a hyperlink.
Add the following code to your HTML document and change the color values and URL as required:
Code
<a style="color: #800000" href="http://www.goldcoastwebdesigns.com/ase/" >Link Text</a>
Output
Notes
Code
<a style="color: #800000; text-decoration: none; background: #80FF80" href="http://www.goldcoastwebdesigns.com/" >Link Text</a>
Output
Notes
© Copyright 2005 - 2012 GoldCoastWebDesigns.com