4

How can I style a anchor tag so that once the link is visited it will change to Red and append [Old] to the end of the link.

So how do I combine these two:

a:visited{
   color:Red
}
a:after{
   content:[Old]
}
jpalladino84
  • 2,480
  • 2
  • 15
  • 16

1 Answers1

4

This is a privacy issue. As browser can detect element styles, it can therefore know what sites did you visit. An right now JS can detect it for a very large number of links in very short time. So for security reasons modern browser's ability to detect :visited class is severely cutted down.

Read more about it on mozilla's blog: http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/

Citation from Webkit changelog:

http://support.apple.com/kb/HT4196

Impact: A maliciously crafted website may be able to determine which sites a user has visited

Description: A design issue exists in WebKit's handling of the CSS :visited pseudo-class. A maliciously crafted website may be able to determine which sites a user has visited. This update limits the ability of web pages to style pages based on whether links are visited.

Similiar questions (have more links):

Community
  • 1
  • 1
Alexey Ivanov
  • 8,128
  • 2
  • 26
  • 27