:visited
Matches links the user has already opened; `:link` matches those not yet visited.
Syntax
a:visited { … }Examples
Visited links are purple:
<style>
a:link { color: royalblue; }
a:visited { color: purple; }
</style>
<p><a href="#">This page (already visited)</a></p>
<p><a href="https://example.com/never-opened-12345">A page you have not opened</a></p>Notes
For privacy, browsers allow only colors to change in :visited — color, background-color, border-color, outline-color. Sizes, images and other properties are ignored.
See also
Related recipes
In the tutorial
- Pseudo-classes — Styles for element states and positions — hover, focus, links, first-child, nth-child, not and form fields.