HTML <body> linkAttribute

HTML body 标签参考手册HTML <body> Tag

Examples

Set the default link color in the document to blue:

<html>
<body link="blue">
<p><a href="../index.html">Example</a></p>
<p><a href="../html/index.html">HTML Tutorial</a></p>
</body>
</html>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the link attribute.


Definition and Usage

HTML5 no longer supports the <body> link attribute. Use CSS instead.

The link attribute of <body> is deprecated in HTML 4.01.

The link attribute specifies the default color of unvisited links in the document.


Compatibility Notes

In HTML 4.01, the link attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the link attribute of the body element is not supported. Use CSS instead.

CSS syntax (<head> section): <style>a:link {color: #FF0000}</style>

CSS example: Set the color of unvisited links in the document

In our CSS tutorial, you can find more information about:link pseudo-classinformation.


Syntax

<body link="color_name|hex_number|rgb_number">

Attribute Values

Value Description
color_name Specifies the font color as a color name (e.g., "red").
hex_number Specifies the font color as a hexadecimal value (e.g., "#ff0000").
rgb_number Specifies the font color as an rgb code (e.g., "rgb(255,0,0)").


HTML body 标签参考手册HTML <body> Tag Other Extensions