View Full Version : <A> element question ?


learning
03-13-2005, 07:00 PM
Hey you experts!
I am trying to find how to change the color of an anchor element
<A href=www.yahoo.com>yahoo home page....
I want to change the color of the <A> element, instead of just using the default.
For example, after a user clicks on the link, I want to change it to purple etc.
Also, want to change the initial display color to something like gray etc..
What is the syntax for that ?

Thank you

Monkey Bizzle
03-13-2005, 07:17 PM
you can do that using CSS. Read about it here:

http://lissaexplains.com/css.shtml

learning
03-13-2005, 11:21 PM
I was hoping to do it without CSS because I am not familiar with CSS. I have seen it done with CSS and I was trying to achieve the same.

But I will definitely review your link. Thank you

Monkey Bizzle
03-13-2005, 11:48 PM
to the current <body> tag that you should already have, add this:

link="#000000" vlink="#000000" alink="#000000"

and change the colors to what you want them to be.

jmosier
03-14-2005, 05:53 AM
Here you go, it's easy....

<head>
<style type="text/css">
<!--
A:link {color:Blue; text-decoration:none}
A:visited {color:Purple; text-decoration:none}
A:hover {color:White; background-color:purple; text-decoration:none; font-weight:bold}
A:active {color:Blue; text-decoration:none}
//-->
</style>
</head>

Edit the colors to anything you want and remove the 'text-decoration:none' if you want the link to be underlined. Just make sure you place the script between the <head> and the </head>.

Have fun.