Document.vlinkColor is a deprecated instance property that gets or sets the color of visited links in the document. Learn what visited links are, how it fits with legacy linkColor and alinkColor, the modern :visited CSS replacement, and five examples with try-it labs.
01
Kind
Instance property
02
Type
string color
03
Status
Deprecated
04
Means
Visited link
05
Replace
CSS :visited
06
Legacy set
link / alink
Fundamentals
Introduction
Browsers remember which links you have opened. A visited link is a hyperlink whose destination URL is already in the user’s browsing history for this site. Visited links often appear in a different color—traditionally purple.
MDN: the vlinkColor property gets/sets the color of links that the user has visited in the document. Like other legacy Document color properties, it comes from the early HTML era when pages styled links globally from JavaScript or <body vlink="..."> attributes.
💡
Learn it, don’t ship it
Study vlinkColor so you can recognize legacy scripts and old tutorials. For new pages, style visited links with CSS: a:visited { color: ... } alongside :link, :hover, and :active.
A getter/setter instance property on Document. Reading it returns the visited-link color string; writing it changes the color applied to visited links in the document body.
Value — a color name (purple, darkviolet) or hex (#551a8b).
Visited state — links the user has already opened in browsing history.
null — assigning null converts to "" (empty string, MDN).
Firefox default — MDN: purple (#551a8b) in Mozilla Firefox.
Document.vlinkColor is deprecated but may still exist for compatibility in some browsers. MDN recommends CSS :visited instead. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Deprecated · Legacy
Document.vlinkColor
Legacy visited-link color getter/setter — use CSS :visited in new code.
LegacyCompatibility only
Mozilla FirefoxSupported · default #551a8b (MDN)
Legacy support
Google ChromeMay expose property · prefer CSS
Legacy / limited
Apple SafariDo not rely on vlinkColor
Legacy / limited
Microsoft EdgeChromium · prefer CSS :visited
Legacy / limited
OperaFollow Chromium behavior
Legacy / limited
Internet ExplorerLegacy Document color APIs
Legacy support
Document.vlinkColorAvoid in new code
Bottom line: Recognize vlinkColor in old scripts. For new styling, use a:link, a:visited, a:hover, and a:active in CSS — never document.vlinkColor.
Wrap Up
Conclusion
Document.vlinkColor is a deprecated way to control the color of visited links in a document. It is useful for understanding legacy pages and migrating them to CSS—not for new features.
Style visited links with CSS a:visited { color: ... }
Keep visited and unvisited colors visually distinct
Replace vlinkColor when updating legacy files
Learn the linkColor / vlinkColor / alinkColor trio for old code
Test link states in real browsers after migrating to CSS
❌ Don’t
Set document.vlinkColor in new production code
Confuse visited with unvisited or active states
Assume the same default purple in every browser
Override :visited with properties browsers block for privacy
Depend on vlinkColor for accessibility contrast
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about vlinkColor
Deprecated visited-link color — prefer CSS :visited.
5
Core concepts
📝01
Type
string color
API
⚠️02
Status
deprecated
Legacy
🔗03
When
visited
State
✓04
Replace
a:visited
CSS
🔄05
Firefox
#551a8b
MDN
❓ Frequently Asked Questions
It gets or sets the color of visited links in the document — hyperlinks the user has already opened in the current browsing history.
Yes. MDN marks Document.vlinkColor as deprecated in the HTML specification. It may still exist for compatibility in some browsers, but you should use CSS a:visited { color: ... } in new code.
A string color name (such as purple or darkviolet) or a hexadecimal color (such as #551a8b). Setting null is converted to the empty string per MDN.
MDN notes the default vlinkColor in Mozilla Firefox is purple (#551a8b in hexadecimal).
linkColor styles unvisited links. vlinkColor styles visited links. alinkColor styles active links while the mouse button is held down. Modern CSS uses :link, :visited, and :active instead.
No. Style visited links with CSS — for example a:visited { color: ... } — or component styles. Learn vlinkColor only to read or migrate old scripts.
Did you know?
The “v” in vlinkColor stands for visited. It paired with linkColor (unvisited) and alinkColor (active) on the old <body link="" vlink="" alink=""> attributes—all replaced today by CSS pseudo-classes.