I have this css:
a:visited { text-decoration: none; decoration: none; }
After a link is visited it changes color.
It is happening to the "Browse All Problems" link on the bottom of the right side of this page: http://www.problemio.com
Thanks!
A purple link can be removed by overriding the default link styles in CSS. Specifically, a purple link indicates that the link has already been visited. So in order to change this style we must change the CSS :visited pseudo class.
Press F12 to open Chrome Developer Tools. Click on the magnifying glass on the upper left and select the visited link. Unclick the CSS rule in the Style section.
Text decoration affects the underline, not the color.
To set the visited color to the same as the default, try:
a { color: blue; }
Or
a { text-decoration: none; } a:link, a:visited { color: blue; } a:hover { color: red; }
In order to avoid duplicate code, I recommend you to define the color once, for both states:
a, a:visited{ color: /* some color */; }
This, indeeed, will mantain your <a>
color (whatever this color is) even when the link has been visited.
Notice that, if the color of the element inside of the <a>
is being inherited (e.g. the color is set in the body
), you could do the following trick:
a, a:visited { color: inherit; }
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