Link to home
Start Free TrialLog in
Avatar of PeterErhard
PeterErhard

asked on

Changing link color

I should remember how to do this, but can't.

How with the following link html code, can I make the color of the link white without using the <body> tag or a css file.

<a href="weblink">link text</a>
Avatar of Khanh Doan
Khanh Doan
Flag of United States of America image

<BODY link="blue" alink="blue" vlink="violet">
alink="color"   For the active link color
vlink="color"   For the visited link color

or

<HEAD>
<STYLE type="text/css">
a.greenlink:link {color: #00a000;}
</STYLE>>
</HEAD>

<A href="somepage.html" class="greenlink">Visit Somepage</A>

Bonmat86.
I don't think you can change color name of the link without using <body> or css.
Bonmat86.
Avatar of PeterErhard
PeterErhard

ASKER

Thanks for your response, but you missed this part in my question:

"without using the <body> tag or a css file"

I want it all contained within the <a href= statement.
This is an<b onmouseout="this.style.color = 'black';" onmouseover="this.style.color = 'red';" align="justify"> example </b>of changing the color of text using a MouseOver.

Oh, you can use it. and use onclick even.
Bonmat86.
ASKER CERTIFIED SOLUTION
Avatar of GrandSchtroumpf
GrandSchtroumpf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess the "link" meant the <a> element, not the ":link" pseudo-class.
Note that if you want to override inline styles, you can use "!important"
For example, this should make your white "link" red on hover:

a:hover {
  color: red !important;
}

<:°)