Thursday, 21 June 2012

How to change the color of Hyperlink

You can set up your own colours for hyperlinks. The default is whatever the user has set in the browser, usually blue, with a blue underline. But you don't have to have blue. The A tag comes with three attributes that can help you to override the browser default:

LINK
Set the colour of a link before it has been clicked on

ALINK
Set the colour of a link when the link is clicked on

VLINK
Set the colour of a link after it has been clicked on

The A and the V above stand for Active and Visited. You use them like this:

<A HREF="pages/about.html" LINK="red">About this site</A>

So you select the attribute you want to use, and then choose a colour for your links. This can also be a hexadecimal or RGB value.

Try them out for yourself with the links in any of your three web pages. Bear in mind, though, that people expect a hyperlink to be blue with an underline - it's a visual clue that you're linking to some extra content. Also, link colours used this way are now out of fashion. It's better to use CSS styles for your hyperlinks.

No comments:

Post a Comment