HTML <body> alinkAttribute
Examples
The color of the active link in the document is set to green:
<p><a href="../index.html">Example Tutorial</a></p>
<p><a href="../html/index.html">HTML Tutorial</a></p>
<p><a href="../html/index.html">HTML Tutorial</a></p>
Try it yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the alink attribute.
Definition and Usage
HTML5 no longer supports the <body> alink attribute. Please use CSS instead.
The <body> alink attribute is deprecated in HTML 4.01.
The alink attribute specifies the color of the active link in the document.
Compatibility Notes
In HTML 4.01, the alink attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the alink attribute of the body element is not supported. Please use CSS instead.
CSS syntax (<head> section): <style>a:active {color: #0000FF}</style>
CSS Example: Setting the color of the active link
In our CSS tutorial, you can find more details about:activepseudo-classes.
Syntax
<body alink="color_name|hex_number|rgb_number">
Attribute Values
| Value | Description |
|---|---|
| color_name | Specifies a text color using a color name (e.g., "red"). |
| hex_number | Specifies a text color using a hexadecimal value (e.g., "#ff0000"). |
| rgb_number | Specifies a text color using an rgb code (e.g., "rgb(255,0,0)"). |
HTML <body> Tag Other Extensions