Easy Tutorial
❮ Ev Onmousemove Av Prop Buffered ❯

HTML <body> link Attribute

HTML <body> Tag

Example

Set the default link color in the document to blue:


Browser Support

All major browsers support the link attribute.


Definition and Usage

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

The link attribute specifies the default color for 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 (in the <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 the :link pseudo-class.


Syntax

Attribute Values

Value Description
color_name Specifies the font color with a color name (e.g., "red").
hex_number Specifies the font color with a hexadecimal value (e.g., "#ff0000").
rgb_number Specifies the font color with an rgb code (e.g., "rgb(255,0,0)").
❮ Ev Onmousemove Av Prop Buffered ❯