tadam logo

HTML <body> vlink Attribute

Example

Set the visited link color to "red" in an HTML document:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body vlink="red">

<p><a href="http://Xhtml.co.il/en/">Xhtml.co.il</a></p>
<p><a title="HTML Tutorial" href="/en/HTML">HTML Tutorial</a></p>

<p><b>Note:</b> If using color names, different browsers may render different colors, and Firefox have problems if the attribute value is in RGB code (will not display correct color).</p>

<p><b>Tip:</b> To produce equal results in all browsers, always use hex code to specify colors.</p>

<p>However, the vlink attribute was deprecated in HTML 4, and is not supported in HTML 4.01 Strict DTD or in XHTML 1.0 Strict DTD. Use CSS instead.</p>

</body>
</html>
The output of the code above will be:

Compatibility Notes

The vlink attribute of <body> is deprecated, and is not supported in HTML 4.01 Strict / XHTML 1.0 Strict DTD.

A deprecated element or attribute is one that has been outdated.
Deprecated elements may become obsolete in the future, but browsers should continue to support deprecated elements for backward compatibility.

Use CSS instead.

CSS syntax (in the <head> section): <style> a:visited {color: #FF0000;} </style>

CSS Example: Set the visited link color to "red" in an HTML document:.

In our CSS tutorial you can find more details about the :visited pseudo-class.

Definition and Usage

The vlink attribute specifies the color of visited links in a document.

Browser Support

The vlink attribute supported in all major browsers

Syntax

<body vlink="value">

Attribute Values

ValueDescription
color_nameSpecifies the link color with a color name (like "red")
hex_numberSpecifies the link color with a hex code (like "#ff0000")
rgb_numberSpecifies the link color with an rgb code (like "rgb(255,0,0)")
Was this information helpful?
   

Comments