October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

CSS Link States: How Early Navigation Matching Worked—and What Privacy Changed

CSS2 defined four link states for history and interaction. See how they worked, why modern CSS uses LVHA order, and what privacy protections restrict today.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Early CSS let authors style links differently depending on whether a destination had been visited, whether a pointer was over the link, or whether the user was activating it. CSS2 defined four anchor states—:link, :visited, :hover, and :active—but today browsers limit what visited-link styling can change and what a page can learn from it, because browsing history is sensitive.

What did CSS2 mean by its four link states?

CSS2 described four pseudo-classes for links. :link matched a link before its target had been visited; :visited matched after a visit; :hover applied while the user designated the link without activating it; and :active applied during activation. The definitions appear in the W3C CSS2 selector text.

As an Amazon Associate I earn from qualifying purchases.

The standard stated, “The four states are mutually exclusive.” It also gave a preference order for cases where more than one state might otherwise appear to apply: :active, then :hover, then :visited, then :link. CSS2 also noted that a user agent could eventually return a link from visited to unvisited status; visited state was not necessarily permanent.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which HTML elements can match link-history selectors?

HTML 5.1 specifies that a, area, and link elements with an href attribute must match one of :link or :visited. The rule is described in the HTML 5.1 selector-matching text. That document also recognizes that more specific rules may mitigate privacy concerns.

Why is modern CSS usually written in LVHA order?

CSS2’s state-preference order describes overlap among states; it is not the recommended order for writing author stylesheets. For ordinary CSS, MDN recommends :link, :visited, :hover, :active—often called LVHA. When selectors have equal specificity, later declarations can take precedence, so putting hover and active rules after link and visited rules lets interaction styles win.

a:link { color: blue; }
a:visited { color: purple; }
a:hover { text-decoration: underline; }
a:active { color: red; }

This illustrates selector order, not a guaranteed default appearance across browsers. See MDN’s references for :link and :visited.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Why can’t a page freely inspect visited links?

If a site could determine which links a visitor had followed elsewhere, it could infer browsing history. Current privacy protections therefore constrain both the matching model and the information exposed to page code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Selectors Level 4 specification describes visited-history matching scoped by destination URL, the origin of the page that initiated navigation, and the top-level site. Its examples explain how this scoping can prevent cross-site tracking through embedded frames.

In practice, MDN documents several limits on :visited:

  • Only a restricted set of color-related properties may be affected.
  • Alpha-channel behavior is constrained to prevent styles from revealing whether a link was visited.
  • getComputedStyle() returns the non-visited value for a visited link.
  • DOM selector APIs do not reveal whether an element matched :visited.

These safeguards preserve a useful visual cue without offering a general-purpose way for a website to read a person’s browsing history.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What can the early standards text establish?

The CSS2 source establishes how the four states were defined and how their overlap was ordered in that standard. It does not establish which browser implemented them first or provide a reliable browser-by-browser adoption chronology. The early history can therefore be described confidently as a standards model, but not as a documented sequence of browser releases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.