4 replies [Last post]
sanch3x
Offline
Enthusiast
Last seen: 10 years 40 weeks ago
Timezone: GMT-4
Joined: 2005-05-27
Posts: 223
Points: 2

Hey,

I'm working on my site and for the longest time I thought my css wasn't working because I was modifying the colors of the link when hovered.

It worked at first but once the link has been visited the hover doesn't work.

I don't know if this is a generic thing or if it's just something I neglected to add so in case of the latter one here is my css:

a.top-menu:active{
	color: #fff;
	text-decoration: none;
	}

a.top-menu:hover{
	color: #0c3; 
	text-decoration: none;
	}
	
a.top-menu:visited{
	color: #fff;
	text-decoration: none;
	}

Is this just an option in the browser? Plee of ignorance here! Tongue

Thanks for any help Smile

Seb

Seb

"Don't worry about Blank let me worry about Blank"

HellsBells
HellsBells's picture
Offline
Leader
Bedford, UK
Last seen: 12 years 10 weeks ago
Bedford, UK
Joined: 2004-04-07
Posts: 851
Points: 0

a:hover doesn't work when link is visited

Hi

Not sure, but it might be to do with the order that your using for the links states.

The order should be:

Link, Visited, Hover and finally Active

Try rearranging them and see if it works.

My strategy is so simple an idiot could have devised it!

"Also, your CSS (no offence) makes me want to gouge my eyes out with a rusty spoon" - TPH

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 18 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

a:hover doesn't work when link is visited

It's the order you declare the psuedo classes in. They should be:

link
visited
hover
(focus)
active

I use LoVe HAte to remember the order Wink

sanch3x
Offline
Enthusiast
Last seen: 10 years 40 weeks ago
Timezone: GMT-4
Joined: 2005-05-27
Posts: 223
Points: 2

a:hover doesn't work when link is visited

Wow guys thanks it did fix the issue(s small glitchy things I had failed to mention).

wolfcry911, you mentioned focus. Does it work the same as hover? And does it mean that if I tab on the link it will show the different colour?

[edit] Guys I'm sorry to have bothered you, I went to look for a tutorial on image positioning and I saw a thread JUST on the subject and it's not like I could of missed it. It's a FAQ on why hovers don't work... [/edit]

Seb

Seb

"Don't worry about Blank let me worry about Blank"

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 15 weeks 5 days ago
Joined: 2004-06-30
Posts: 9668
Points: 801

a:hover doesn't work when link is visited

I've PMed Tony to see if I can add in the discussion about :focus and :active.

Verschwindende wrote:
  • CSS doesn't make pies