CSS link color problem

K

Kathleen Coyne

For some reason, I just can't change the font color for hover. It
allows me to change the background color, no problem. But, if the
link is visited, it will not change the font color, if the link is
unvisited, then it will change the font color on hover.

Here is my CSS

#content a:link {
color: #CACBCA;
font-weight: bold;
}

#content a:hover {
background-color: #ffffff;
color: #048004;
font-weight: bold;
}

#content a:visited {
color: #CACBCA;
font-weight: bold;
}

any ideas?
 
S

Steve Pugh

For some reason, I just can't change the font color for hover. It
allows me to change the background color, no problem. But, if the
link is visited, it will not change the font color, if the link is
unvisited, then it will change the font color on hover.

Here is my CSS

#content a:link {
color: #CACBCA;
font-weight: bold;
}

#content a:hover {
background-color: #ffffff;
color: #048004;
font-weight: bold;
}

#content a:visited {
color: #CACBCA;
font-weight: bold;
}

If a link is visited and being hovered then which rule is applied? The
one specified last in the CSS. Swap the two rules around and hover
will apply to visited as well as unvisited links.

Steve
 
P

PeterMcC

Kathleen said:
For some reason, I just can't change the font color for hover. It
allows me to change the background color, no problem. But, if the
link is visited, it will not change the font color, if the link is
unvisited, then it will change the font color on hover.

It's the cascade that's doing it - define them in the order
link
visited
hover
active

Currently, your visited definition comes after the hover so a visited link
that gets hovered has to decide on whether it will display as visited or
hovered - the latter definition takes precedence so you get a visited
appearance.
 
M

Mike

<style>

<!--
A:link { color: #808080; text-decoration: none}
A:active { color: #808080; text-decoration: none}
A:visited { color: #808080; text-decoration: none}
A:hover { color: #FF0000; text-decoration: none}

-->
</style>

-Mike
 
T

T.J.

Kathleen Coyne said:
For some reason, I just can't change the font color for hover. It
allows me to change the background color, no problem. But, if the
link is visited, it will not change the font color, if the link is
unvisited, then it will change the font color on hover.

Here is my CSS

#content a:link {
color: #CACBCA;
font-weight: bold;
}

#content a:hover {
background-color: #ffffff;
color: #048004;
font-weight: bold;
}

#content a:visited {
color: #CACBCA;
font-weight: bold;
}

any ideas?

Remember,

Luther
Vandross
Has
Acne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top