6 replies [Last post]
Neil
Offline
newbie
Lynnwood, WA
Last seen: 17 years 45 weeks ago
Lynnwood, WA
Joined: 2003-08-04
Posts: 2
Points: 0

I'm trying to get the a:hover to always work regardless of whether the link has been visited before or not. Can't seem to accomplish this. You can see an example here: http://www.boosterseat.org/faqs.htm

Here is the css code controlling the link colors:
a:link { color: #000099}
a:visited { color: #000099}
a:hover { color: #FF0000}
a:active { color: #000099}

The full css file is here: http://www.boosterseat.org/default.css

Any way to accomplish this?

Thanks,

Neil

vavroom
Offline
Enthusiast
Aotearoa / New Zealand
Last seen: 14 years 28 weeks ago
Aotearoa / New Zealand
Joined: 2003-07-19
Posts: 75
Points: 0

a:hover link color

Have you tried putting your declaration for the hover before the declaration for the visited?

Nic
"A community that excludes even one of its members is no community at all" - Dan Wilkins

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 4 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

a:hover link color

I thought that was the right order ? :?

http//melbourne.ug.php.net

vavroom
Offline
Enthusiast
Aotearoa / New Zealand
Last seen: 14 years 28 weeks ago
Aotearoa / New Zealand
Joined: 2003-07-19
Posts: 75
Points: 0

a:hover link color

Packet, yeah, it would seem it is the right order, but somehow I've had a situation like that and reversing the order fixed it... Weird stuff sometimes

Nic
"A community that excludes even one of its members is no community at all" - Dan Wilkins

Neil
Offline
newbie
Lynnwood, WA
Last seen: 17 years 45 weeks ago
Lynnwood, WA
Joined: 2003-08-04
Posts: 2
Points: 0

a:hover link color

I tried what you suggested and the problem still remained. However by removing the a:active and a:visited and leaving only the a:link and a:hover tags solved the problem. The mouseover always works now. The only remaining phenomenon is that the a:visited color is shown as the default. In this case it is not a problem but I'm sure there are some cases in which it would be. It must be a CSS glitch.

Thanks for your help guys,

Neil

d3signmonk3y
d3signmonk3y's picture
Offline
Enthusiast
Toledo, Ohio
Last seen: 17 years 46 weeks ago
Toledo, Ohio
Timezone: GMT-4
Joined: 2003-07-29
Posts: 59
Points: 0

a:hover link color

By running your stylesheet through the W3C validator

http://jigsaw.w3.org/css-validator/validator-uri.html

I found that it seems to be choking on the empty

clip: rect( );

declaration for the class named menu.

Another thought is I was working on a site recently where the person who designed it had used invalid characters for some of the class names and it was causing unpredictable CSS behavior from browser to browser. I can't remember if a "-" in the name is allowed or not, but you may want to remove them and see if that clears up the problem.

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 4 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

a:hover link color

d3signmonk3y wrote:

I can't remember if a "-" in the name is allowed or not, but you may want to remove them and see if that clears up the problem.

I can confirm that underscores and hyphens are not allowed in CSS declarations.

http//melbourne.ug.php.net