:visited pseudo-class
Specifies the style of an a element if the link has been visited recently.
![]() |
Syntax
selector:visited {...}Parameters
- selector
-
A CSS simple selector.
Standards information
- CSS 2.1, Section 5.11.2
Remarks
:visited is often used with :active, :hover, and :link, which are the pseudo-classes that reflect the other states of a link.
The default value of the :visited pseudo-class varies by browser, as does the amount of time used to define a recent visit.
Windows Internet Explorer 8. For security reasons, :visited is not supported by querySelector or querySelectorAll; for more information, see Selecting Objects with JavaScript.
Examples
The following style rule uses :visited to set the color attribute of visited links in a document.
<style>
A:visited { color:blue }
</style>
Show:
