This page shows 2 easy ways to change the color of hyperlinks using CSS code.

The first way is on-the-fly with Inline CSS by adding the style attribute directly into the hyperlink code, inserting a color property into the style attribute then giving the color property a color value. Hyperlink colors can also be changed easily with external CSS (examples below).



Replace the URL, href attribute value, and the color property value #cc0000 with your own. See hex color chart and color names chart to get more colors.

<a href="http://www.hyperlinkcode.com/change-hyperlink-color.php" style="color: #cc0000">change hyperlink color</a>


change hyperlink color


a {
color: #cc0000;
}

a:link {
color: #cc0000;
}
a:visited {
color: #999999;
}
a:hover {
color: #ff3300;
}

div#my_container a {
color: #cc0000;
}

p.my_class a {
color: #cc0000;
}

ul.my_list a {
color: #cc0000;
}


One of the major benefits of using an external stylesheet is that you can control all hyperlinks on an entire website by simply editing one file. Another good benefit is that many cool hyperlink effects can be acheived to improve the look and feel of your website. Instructions for external stylesheet.



See also: How to change hyperlink underline color.


Web Design