开发者

a:visited is not working on mozilla but works fine on IE

a:visited function works fine on my IE but not on mozilla. It has no effect on Mozilla. Css class is

            ul#menu1 li a:link, a:visited { 
    display: block; height: 18px; padding: 5开发者_如何学Gopx 0 6px 15px;
    text-decoration: none; clear: both; color: #666; 
             }


The visited style has been removed from Firefox (and most other browsers) in recent versions due to a security issue with it.

The problem is that a malicious web site could work out your browsing history by using it - they would set a visited colour, produce a load of URLs (even hidden ones so the user doesn't know about it), and check their colour. It caused quite a bit of noise in browser security circles a couple of years ago.

The visited feature can be switched back on again in Firefox, by going to the security preferences, but it is disabled by default, and most users will have it switched off.

See here for more info on the problem and how Firefox went about fixing it: http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/


Try changing your order so that it is :link, :visited, :hover, :active

Also ensure that your Mozilla options are set to remember your browsing history. If it doesn't remember the history, it can't know what you have visited or not.

Edit: It doesn't look like Mozilla has disabled the ability to differentiate visited links, but it appears that they have limited what properties you can use. See here for more details.


just make your selector more specific

ul#menu1 li a:link, ul#menu1 li a:visited { 
  //code here  
}

Note that I added ul#menu1 li in front of a:visited

what you have at the moment doesn't specify that the a:visited in question is the one inside the ul#menu1 li tag


Try to change you selector like that:

#menu1 a:link, #menu1 a:visited { ... }

It should apply the css for all a:visited or a:link in the element where the id is menu1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜