English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
IEFirefoxOperaChromeSafari
All mainstream browsers support the link attribute.
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.
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.
<body link="color_name|hex_number|rgb_number">
Value | Description |
---|---|
color_name | Specify the font color with a color name (for example, "red"). |
hex_number | Specify the font color with a hexadecimal value (for example, "#ff0000"). |
rgb_number | Specify the font color with an RGB code (for example, "rgb("255) |