Mobile app version of vmapp.org
Login or Join
Karen161

: Text-decoration under anchor tag I have this snippet: <p><a href="http://www.example.com">Link to example site.</a> </p> a:link{ color:green; text-decoration:none; } a:visited{

@Karen161

Posted in: #Css3 #Html5

I have this snippet:

<p><a href="http://www.example.com">Link to example site.</a> </p>




a:link{
color:green;
text-decoration:none;
}


a:visited{
color:pink;
text-decoration:underline;
}

a:hover{
color:yellow;
text-decoration:underline;
}


Can someone explain why the text-decoration:underline; for a:visited does not work?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen161

2 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

The text-decoration has to be the same on every type of link.
Look at this question from stackoverflow.com

When you remove your text-decoration:none from a:link, a:visited would be underlined.

10% popularity Vote Up Vote Down


 

@Jennifer507

The functionality of :visited pseudoclass has been restricted in many modern browsers (Fx4, IE9, Chrome) to prevent CSS exploit. You can read about it here, but the crux is:


For many years the CSS :visited selector has been a vector for querying a user’s history. It’s not particularly dangerous by itself, but when it’s combined with getComputedStyle() in JavaScript it means that someone can walk through your history and figure out where you’ve been.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme