Skip to content Skip to sidebar Skip to footer

Set Color For Visited Links

I have found many posts on how visited doesn't work anymore (most of them pretty old posts) on modern browsers. One of them: Google chrome a:visited background image not working Th

Solution 1:

Really? Are you talking about CSS pseudo-classes? These are not obsolete, can we see your code?

a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: yellow;}

http://www.w3.org/TR/CSS2/selector.html#link-pseudo-classes

http://css-tricks.com/snippets/css/link-pseudo-classes-in-order/

https://developer.mozilla.org/en-US/docs/CSS/Pseudo-classes


Solution 2:

The following CSS should be able to style anchor tags on all modern browsers:

a:link {
    color:#222;
}
a:hover {
    color:#000;
}
a:active {
    color:#000;
}
a:visited {
    color:#444;
}

.link specifies the link color, .hover will change the color of the link when moused over, .active will specify the active link color, and .visited will specify the color of the link after it has been clicked.


Post a Comment for "Set Color For Visited Links"