0

I'm using A:visited { color: red ! important } in Stylish to change the color of URL's i already visited. But, there are two problems with this code:

  • It only works on texts and sometimes the link is only embeded in an image.
  • It doesn't color old links. If I click an HTTP link but the site now works with HTTPS this code is useless.

I tried to solve the image problem using a border around the visited images with this code A:visited { border-image: 4px solid red }

but it didn't work and I have no idea why.

  • 1
    is `border: 4px solid red` not working ... i dont think border-image is the right property – ashish singh Mar 19 '17 at 16:49
  • Possible duplicate of [Why doesn't this a:visited css style work?](http://stackoverflow.com/questions/8331688/why-doesnt-this-avisited-css-style-work) – Brock Adams Mar 19 '17 at 21:21
  • Stylish cannot do this for security reasons. Greasemonkey and Tampermonkey also do not provide this capability. The only way is for you to write your own browser extension -- these can access the history API. – Brock Adams Mar 19 '17 at 21:26
  • try adding a white border to just the `:link` selector: `{ border-bottom: 4px solid; color: white; }` It should also add the border to visited 'images' but in the color of visited links. – Mark Jeronimus Dec 11 '22 at 20:56

1 Answers1

0

The styles you can apply to :visited are very limited for security reasons.

https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector

You will still be able to visually style visited links, but there are now limits on what styles you can use. Only the following properties can be applied to visited links:

  • color
  • background-color
  • border-color (and its sub-properties)
  • outline-color
  • The color parts of the fill and stroke properties
Michael Coker
  • 52,626
  • 5
  • 64
  • 64