Changing the Default Color for All Link States

If you want to change a link's default color, and if you want to have the same color apply to the link regardless of state, simply add a style rule to the style attribute of the link's anchor tag:

<a href="../special.htm" style="color: #FF0000;">See Our Specials</a>

In this example, the hyperlink always appears in red, no matter the state of the link or the default link colors.

Alternately, if the same formatting applies to more than one link on the page, you can create a class style to control the special hyperlink color:

 <style type="text/css"> a.special { color: #FF0000; } </style> <body> <a class="special" href="../special1.htm">See Our Specials</a> <a class="special" href="../special2.htm">See ...

Get Web Design Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.