English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <body> link attribute

The link attribute specifies the default color of unvisited links in the document. HTML5The <body> link attribute is not supported. Please use CSS styles to implement.

 HTML <body> tag

Online Example

Set the default link color to 'green' in the HTML document:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<body> link attribute - Basic Tutorial Website oldtoolbag.com/title>
<body link="green">
<p><a href="https://www.oldtoolbag.com">Basic Tutorial Website</a></p>
<p><a href="https://www.oldtoolbag.com/html/">HTML Tutorial</a></p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the link attribute.

Definition and Usage

HTML5 is no longer supported. Please use CSS instead.

The link attribute of the <body> in HTML 4Strict DTD does not support the link attribute of the body element; in XHTML1 is deprecated.

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

Compatibility Comments

HTML 4Strict DTD does not support the link attribute of the body element; in XHTML1 It is not recommended to use the link attribute of the body element; in XHTML 1Strict DTD does not support the link attribute of the body element. Please use CSS instead.

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

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

In our CSS tutorial, you can find more about :link  Pseudo-class.

Syntax

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

Attribute value

ValueDescription
color_nameSpecify the font color with a color name (for example, "red").
hex_numberSpecify the font color with a hexadecimal value (for example, "#ff0000").
rgb_numberSpecify the font color with an RGB code (for example, "rgb("255)
 HTML <body> tag