Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS link color

Status
Not open for further replies.

balance

Programmer
Feb 5, 2002
52
0
0
CA
I am having constant trouble getting the basic link to take the color I assign in a .css file. Visited, active, and hover are all working but the link won't. The body tag contains no reference to the color of links and still it defaults to the blue.

Why would the others work but not this one? Here is the code I am using:

A:link
{
color: #0066CC;
}


Thanks for all the help

AJ
 
This may not make sense but I found that the order of the code has an effect. I think it should be:
a:link
a:active
a:visited
a:hover

Does this make sense, probably not! :/ But I had trouble before that the colours were not displaying the way i wanted them to and when I rearranged the code as above it worked! Wierd.

É **new site coming soon**
**don't visit just yet**
 
Just specify the color of the a-tag itself, like:
A { color: #0066CC }
 
Here's an example...
Code:
<style type=&quot;text/css&quot;>
<!--
a:active {  color: #00FF00; text-decoration: none}
a:hover {  color: #0099FF; text-decoration: none}
a:link {  color: #FFCC33; text-decoration: none}
a:visited {  color: #003399}
-->
</style>

But don't forget to clear the cache before reviewing the page.

Hope it'll help ;-) Have Fun...

Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top