Browsers do not comply: visited {text-decoration: none; }

I cannot remove the underline from the links I visited. On my computer, the script below shows black, underlined text for the visited link in any browser (current versions of Chrome, Firefox, and IE).

a:link { color: red; text-decoration: underline; } a:visited { color: black; text-decoration: none; } 
 <p><a href="http://www.nevervisited.com">This link is not visited.</a></p> <p><a href="http://www.google.com">This is link is visited.</a></p> 

This is the Chrome inspector for the visited link.

I suspect that a:visited is gray, something has something to do with it, but this question about gray styles did nothing for me, although it helped a lot of others.

These answers ( this , this ) show that the specification does not care about the children of text-decoration when their ancestor defined it, but I do not think this is the case here. My <a> does not have underlined parents, and I do not use pseudo-elements, but pseudo-classes.

Also, why does Chrome apply a:link to the visited link if the W3C says that

The two states [ a:link and a:visited ] are mutually exclusive.

Perhaps this is due to the fact that user agents hide personal information from websites, for example, does the W3C offer right after the previous quote? It:

Note. . Scripting authors may abuse the :link and :visited pseudo-classes to determine which sites the user visited without user consent.

Thus, UAs can treat all links as invisible links or implement other measures to preserve user privacy while viewing visited and unaffected links in different ways.

+6
source share
1 answer

The only CSS property that you can apply to a:visited links in most Webkit-based browsers (like Safari) or Blink-based (Chrome and Opera) is color . Nothing else will work. This has something to do with stealing browser history. You can learn more about this from here:

http://seclists.org/fulldisclosure/2013/May/13

However, you can change the style of all links with a {text-decoration: none;} .

The selector itself is not dangerous, but if you combine it with Javascript functions like getComputedStyle () , everything can become pretty ugly and ugly. means that other users can view and read your personal browser history.

Mozilla (Gecko engine) limited the selector properties to color , background-color , border-*-color .

+7
source

All Articles