CKTIS / CSS
:visited — visited-link pseudo-class
The :visited pseudo-class styles visited hyperlinks. Its behavior depends on browser history and privacy protections.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
:visited { color: purple; }:visited selects hyperlinks whose destination the browser considers visited. In HTML, it applies only to a and area elements with an href attribute; it does not apply to link elements or anchors without href.
:link and :visited are mutually exclusive; :any-link covers both. :visited takes no arguments and does not mean currently being clicked.
Privacy protections can restrict matching, applied styles, and information returned by getComputedStyle(). Do not use this pseudo-class to read user history or store application progress.
The example changes only color. Inspect it visually after following the link and returning; a color change is not guaranteed. The specification even permits :visited never to match.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Visited link</title>
<style>
a:link { color: #0055aa; }
a:visited { color: #663399; }
</style>
<a href="?destination=1">Open destination</a>
</html>Result
The link is blue (#0055aa) when treated as unvisited and purple (#663399) when treated as visited. Privacy restrictions may keep it blue after navigation. No console output.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.