Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't my visited link have a background color?

It seems that a:visited won't work in showing background color on my links.

http://jsfiddle.net/davestein/D2srA/

What super simple thing am I missing?

like image 675
Dave Stein Avatar asked May 04 '11 20:05

Dave Stein


2 Answers

The background-color on a:visited only seems to work (as Dave said above, in FF, Chrome and Safari) if the normal a has a background-color, either explicitly defined or through inherit (the direct parent must actually have a background-color for this to be true).

Obviously it is not ideal to have to define a background-color for a all the time, as the site may have a background image.

CSS bug..?

like image 148
Jackie Avatar answered Oct 13 '22 09:10

Jackie


try a) setting a default background color (like #fff) and b)removing !important, as shown here:

http://jsfiddle.net/D2srA/10/

like image 24
Thomas Shields Avatar answered Oct 13 '22 09:10

Thomas Shields