Jitendra Vyas
Jitendra Vyas

Reputation: 152935

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?

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/

Upvotes: 8

Views: 1776

Answers (2)

gtamil
gtamil

Reputation: 552

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/

Upvotes: 4

Anna Völkl
Anna Völkl

Reputation: 1664

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.

Upvotes: 2

Related Questions