I was reading about :visited
pseudo class on MDN and they said that :visited
pseudo class can be overridden by :link
pseudo class:
The :visited CSS pseudo-class lets you select only links that have been visited. This style may be overridden by any other link-related pseudo-classes, that is :link
I am not able recreate this feature. I tried two scripts. One with :link
mentioned before :visited
and then the other way round but both the scripts work the same. In the following script the :link
pseudo class doesn't override the :visited
pseudo class -- The anchor element becomes red when it is visited not green.
a:visited {
color: red;
}
a:link {
color: green;
}
<a href="http://www.hello.com">Go to Hello.com </a>
So, how does :visited
pseudo class get overridden by :link
pseudo class? Would there be any observable difference if :link
is declared after or before :visited
in the style sheet?