views:

1512

answers:

8

I have created a link and when I try to set the style;

a:visited {
    text-decoration: underline;
    color: #FF0000;
}

It doesnt seem to work. It works fine in IE. I have also followed the order; link, visited, hover, active.
Is this a known issue, or am I making any mistake?

+4  A: 

Download the Firebug or WebDeveloper plugin for Firefox and use it to examine the style of the link, say using Inspect, to see where the style is being set. You should be able to see what styles are being applied and from where.

tvanfosson
A: 

It's likely being overridden by another style. If you have the Web Developer toolbar installed you can see what CSS styles are in affect and where they came from by selecting "View style Information" from the CSS menu.

acrosman
+6  A: 

It might have to do with specificity and the order that you have your selectors in. In general, when specifying link states you should follow the "lo**v**e/hate" principal:

  1. :link
  2. :visited
  3. :hover
  4. :active

Maybe you have the :hover or :active selector before :visited?

Justin Gallagher
A: 

I am having this same issue. The visited link color works on other browsers, but is not working in Firefox. Note that I am using Firefox 3.5 on a Mac; I've not yet tested with Firefox on Windows to see if this issue is a bug on the Mac version.

I have a:link before a:visited and I tried putting !important in there but it didn't help. I'm about to try removing everything from my style-sheet other than a:visited to see if it works then; that would ensure there aren't any other styles overriding things, right?

jhocking
+1  A: 

I am also having this problem. I reduced my css down to just 4 rules (a:link, a:visited, a:hover, a:active), and am still having that problem. Perhaps it's a feature of firefox 3.5? or maybe a bug? Three of the rules work....visited does not. Any ideas?

A: 

Go to Tools -> Options and check if Firefox is remembering your browsing history. If this option is unchecked then the browser cannot show you which links you have visited because you denied the browser that information, hence the reason why your visited links do not change color.

Erwin Boots
+1  A: 

i have heard it is to do with the security - so something under the firefox hood disables visited links from showing so that other software cannot inspect the active styles and figure out where a user has been.

that does sort of make sense, but they should make it an option, and they should also EXPLAIN TO PEOPLE THAT THAT IS WHAT THEY HAVE DONE and save us all some time.....

puddleglum
A: 

Thank you Erwin! That helped me a lot.

Jim