Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

background-color doesn't work on a:visited but it works if i add any background color to a {background:#fff}, Is it a bug?

Tags:

html

css

w3c

background-color doesn't work on a:visited but it works if i add any background color to a {background:#fff}, Is it a bug?

See this example http://jsfiddle.net/jitendravyas/CMWWm/1/ green background on a:visited will not work. But

Now if i add a {background:#fff} at top then green background on a:visited will start to work. http://jsfiddle.net/jitendravyas/D6vGX/1/

like image 466
Jitendra Vyas Avatar asked Oct 04 '11 11:10

Jitendra Vyas


2 Answers

Check it, Firefox doing something privacy-related changes to :visited , Its looking strange,

We’re limiting the CSS properties that can be used to style visited links to color, background-color, border-*-color, and outline-color and the color parts of the fill and stroke properties. For any other parts of the style for visited links, the style for unvisited links is used instead.

--from mozilla

http://hacks.mozilla.org/2010/03/privacy-related-changes-coming-to-css-vistited/

like image 89
gtamil Avatar answered Sep 22 '22 13:09

gtamil


hm, works if you add background-color: white to your a:link.

a:link {
    color: red;
    font-size: 3em;
    background-color: white;
}

i'm not sure if this is relly a bug or something else.

like image 42
Anna Völkl Avatar answered Sep 23 '22 13:09

Anna Völkl