a:-webkit-any-link {
color: -webkit-link;
text-decoration: underline;
cursor: auto;
}
I can't override this css. I tried this post Blue lines under links on my site even though I've disabled all related CSS? I tried a lot. Still its not working. I don't want to modify each and every machine to change the user agent stylesheet. Please help.
The :any-link CSS pseudo-class selector represents an element that acts as the source anchor of a hyperlink, independent of whether it has been visited. In other words, it matches every <a> or <area> element that has an href attribute. Thus, it matches all elements that match :link or :visited .
color: -webkit-link usually the color of HTML <a> is blue.
if you are saying that the styling
a:-webkit-any-link {
color: -webkit-link;
text-decoration: underline;
cursor: auto;
}
is being set automatically somehow and you want to override it, start by simply setting anchor styling in your CSS:
a, a:link, a:visited, a:focus, a:hover, a:active{
color:olive;
text-decoration:none;
cursor: crosshair;
}
If this doesn't work for some reason, add additional selectors to increase the specificity of your rule, eg
body a{
...
}
if this still doesn't work, use the dreaded !important
color:olive !important;
see this live:https://jsfiddle.net/panchroma/z7mkvbeu/
Good luck!
The specificity David has warned you about is key to overriding rules, when all code is right. Without seeing your code, I cannot know if this applies to you, but to other coders to land here: please double check your rule. It is very likely that you have a typo on your rule, causing it not to be recognized and the default to be applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With