Why I am unable to change padding for the visited link? I am trying this:
HTML:
<a href="#">link</a>
CSS:
a{
display: block;
background: green;
padding-left: 100px;
}
a:visited{
background: red;
padding-left: 0;
}
Demo: http://jsfiddle.net/ZVZWW/
Unfortunately, due to security concerns, the list of styles you are allowed to apply to :visited
elements is limited. In the past, hackers have been able to sniff history from users by checking for differences in styles of normal links, and ones the user had previously visited. More on the security concerns here, and what styles are allowed: https://blog.mozilla.org/security/2010/03/31/plugging-the-css-history-leak/
As for allowed styles and modifications to :visited
elements, here is a what MDN has documented on the subject:
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 fill and stroke colors
In addition, even for the properties you can set for visited links, you won't be able to change the transparency between unvisited and visited links, as you otherwise would be able to using rgba() or hsla() color values or the transparent keyword.
Only the following properties can be applied to visited links:
color
background-color
border-color (and its sub-properties)
outline-color
Source : - Privacy_and_the_:visited_selector
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