HTML body alink Attribute
HTML <body> tag
Definition and Usage
The alink attribute specifies the color of the active links for a page.
When a link is activated (clicked), the color changes to indicate that the
link has been activated. This is called an active link (or in this case, alink).
The active link color is seldom noticeable unless the target frame of the
link is a new/different frame.
Compatibility Notes
The alink attribute of the body element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax (in <head>): <style>a:active {color: #0000FF}</style>
In our CSS tutorial you can find more details about the
:active pseudo-class.
Syntax
<body alink="color_value">
|
Syntax Example
Attribute Values
Value |
Description |
color_name |
Specifies the active link color with a color name, like "red" |
RGB_value |
Specifies the active link color with a RGB value, like "rgb(255,0,0)" |
Hex_value |
Specifies the active link color with a hex value, like "#ff0000" |
Browser Support

The attribute is deprecated, but supported in all major browsers.
Example
<html>
<body alink="red">
<a href="/default.asp" target="_blank">W3Schools</a>
</body>
</html>
|
Try-It-Yourself Demos
body alink
attribute example
Set the color of an active link with the body alink attribute
In CSS:
active link style example
Set the color of an active link with CSS.
HTML <body> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|