Forum Moderators: mack

Message Too Old, No Replies

Underline with hover, always & only with hover, link visited or not

using active, hover, and visited in a CSS style sheet

         

Ed_Gibbon

6:42 pm on Jun 9, 2003 (gmt 0)

10+ Year Member



I have some links with style defined in an external CSS style sheet. I want the color to change and the underline to show when the mouse goes over them.

It works nicely before the link is visited. Once it is visited then the rollover effect is gone -- it just takes the "visited" style all the time, with or without hover.

Is there a way to always have the same link rollover style all the time, whether the link has been visited or not? Anything like "hover : unvisited" and "hover : visited" that could be set the same?

If I do not specify anything for the "visited" style, then the link takes the browser default for visited links -- which is not what I want.

Maybe this helps:

page not visited, no rollover:
--I want red text, no underline (I get it okay)

page not visited, rollover:
--I want white text and underline (I get it okay)

page visited, no rollover:
--I want red text, no underline (I get it okay)

page visited, rollover:
--I want white text and underline (Can't figure it out!)

Thanks!

pageoneresults

6:47 pm on Jun 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



?

a:link, a:visited{
color:#f00;
background:transparent;
text-decoration:none;
}

a:hover{
color:#fff;
background:transparent;
text-decoration:underline;
}

P.S. There is also an a:active rule that you can add which controls the link state on click. It must come after the a:hover rule to work properly...

a:link, a:visited{
color:#f00;
background:transparent;
text-decoration:none;
}

a:hover{
color:#fff;
background:transparent;
text-decoration:underline;
}

a:active{
color:#000
background:#eee;
text-decoration:underline;
}

grahamstewart

10:42 pm on Jun 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No need for a:link and a:visited just do..


a {
color:#f00;
background:transparent;
text-decoration:none;
}
a:hover {
color:#fff;
background:transparent;
text-decoration:underline;
}

Ed_Gibbon

1:01 pm on Jun 10, 2003 (gmt 0)

10+ Year Member




Thanks. WebmasterWorld is the greatest!