Forum Moderators: not2easy

Message Too Old, No Replies

hover color

         

Sievert

3:42 pm on Jan 7, 2004 (gmt 0)

10+ Year Member



I just started using css and I like the whole hover color thing, but I was wondering if there is a way for visited links to change color too. Here's the code I'm using:

A:link {
color: #32cd32;
background-color: transparent;

}
A:hover{
color: #ffa500;
background-color: transparent;
text-decoration: none;
}
A:actve{
color: #ffffff;
background-color: transparent;
}
A:visited{
color: #cd853f;
background-color: transparent;
text-decoration: none;
}

there has to be a way to do this, any tips?

DrDoc

3:50 pm on Jan 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

It is important that the pseudo classes are defined in the right order:
link, visited, hover, active, focus

In your case, since visited comes last, it overrides the hover rule.

dougie

4:06 pm on Jan 7, 2004 (gmt 0)

10+ Year Member



link, visited, hover, active, focus

I've heard of the first 4, but what is focus please?

Safir

4:18 pm on Jan 7, 2004 (gmt 0)

10+ Year Member



The :focus pseudo-class applies while an element has the focus (accepts keyboard events or other forms of text input).

(From: [w3.org...]

Sievert

8:59 pm on Jan 7, 2004 (gmt 0)

10+ Year Member



thanks, I appreciate the advice.

markd

7:09 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there

Is there a way to 'toggle' a visited link colour on and off?

By this I mean:

If you click 'link 1' it shows the visited colour, but when you click 'link 2' beneath it, the visited colour goes back to 'inactive' on 'link 1' whilst 'link 2' shows the visited colour.

In this way in a set of HTML, text links for a sub navigation you could show which is the currently active link.

Any help appreciated.

Thanks