Jump to content

change text background colour


richardglobal
 Share

Recommended Posts

Firefox browser. I want to change the colour of visited links. As they can come on backgrounds of any colour I also changed their background colour to make them reliably visible. This worked fine until browsers stopped supporting this. Is there any way I can get this back or use another text effect (shadow?). I used a userContent.css file containinga:visited { color: #C000C0 !important; background-color: #E0E0E0 !important; }Curiously, this works on a few links on the W3 site - eg the 'try me' ones - but not on any others. The examples on the site all seem to refer to changing styles and are aimed at people writing web pages, not just modifying the results of existing ones. Thanks for any help.

Link to comment
Share on other sites

I think you will found that images are not supported for visited links, as these can be stored in cache so someone can identify where you have been, so border color, background, text colors , which cant be stored should be fine. Are you applying them in the correct order a:linka:visiteda:hovera:active as that will make a difference.

Link to comment
Share on other sites

do you ref to a:visited anywhere else that has a id ref against it? if in container with id ref id="container" and you target links with #container a {color: lime;} and you use a:link {color: green;} the id ref has higher priority than anchor selector on its own.

Link to comment
Share on other sites

Thanks, dsonesuk. The entire userContent.css file is: a:link {text-decoration:none; }a:visited { color: #C000C0 !important; background-color: #E0E0E0 !important; }a:hover { text-decoration: underline !important; } Everything works except the background-color part. As I said, this used to work until, I was informed, it was dropped from newer versions of css and browsers stopped supporting it. Remember that I'm not writing these websites, just trying to display them in a reliably readable form. Another text attribute like shadow or outline would be fine if only I could get them to work!!

Link to comment
Share on other sites

That was a good one, dsonesuk. Your suggestions work. They also work for a:hover. The linea:hover { background-color: #E0E0E0 !important; color: #C000C0 !important; }produces exactly the effect I want. BUT it doesn't work at all with a:visited!!! I've tried changing various settings in firefox in case they were inhibiting it but without success. How annoying!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...