[CSS Selector] E:visited
Using 'selector:visited' applies styles to elements whose link destination has been visited. Since it targets elements that have a link destination, it is mainly used on 'a' elements. This is generally called a 'pseudo-class' (the :visited pseudo-class).
Note that it may be overridden by other pseudo-classes, so pay attention to the order in which you write them. Writing them in the order ':link', ':visited', ':hover', ':active' (the 'LVHA' order) will prevent conflicts.
In particular, ':visited' must be written after ':link'.
Sample Code
a:link { color: red;}
a:visited { color: orange;} /* When separating styles for unvisited and visited links, always write ':visited' after ':link' as shown here. */
Browser Display Result
※ To try the sample below, please clear your browser history first.
a:visited { color: red;} /* Sets the text color of visited links to red. */
<p><a target="_top" href="https://www.google.co.jp/">Goes to Google. After visiting and returning, the color will change.</a></p>
Browser Compatibility
8 ○
7 ○
6 ○
2 and earlier ×
Android Browser
4.4+ ○
3 and earlier ×※ Version data is based on MDN.
If you find any errors or copyright issues, please contact us.