The obsolete HTML alink attribute was historically used with the <body> element to specify the color of active hyperlinks while they were being activated by the user.

Historical Syntax

The alink attribute was added to the <body> element and assigned a color value:

<body alink="red">

When supported, the specified color was applied to hyperlinks while they were in their active state.

Historical Elements

The alink attribute was historically associated with the <body> element.

Element Historical Purpose
<body> Specified the color used for active hyperlinks throughout the document.

Historical Use

The alink attribute allowed webpage authors to choose the color displayed when a hyperlink was being activated. It was commonly used together with the obsolete link and vlink attributes, which controlled the colors of unvisited and visited links.

Because the attribute was placed on the <body> element, the selected active-link color generally applied throughout the document rather than to an individual hyperlink.

Why It Became Obsolete

The alink attribute controlled presentation directly from HTML. As CSS became the standard way to control webpage appearance, link colors and link states could be styled more consistently and with much greater flexibility.

CSS also allows different groups of links to have different styles instead of requiring one active-link color for the entire document.

Modern Alternative

Use the CSS :active pseudo-class to style a hyperlink while it is being activated.

Historical HTML

<body alink="red">

  <a href="https://www.example-web.site/">Example Link</a>

</body>

Modern HTML and CSS

<a href="https://www.example-web.site/">Example Link</a>

<style>
a:active {
  color: red;
}
</style>

The :active pseudo-class applies while an element is being activated. For a typical mouse interaction with a hyperlink, this state can be visible while the mouse button is pressed on the link.

Play in Editor

Learn More About Styling Links

The CSS tutorials provide more information about styling hyperlinks and using pseudo-classes:

  • CSS Styling Links - Learn how CSS controls the appearance of hyperlinks and their different states.
  • CSS Pseudo-classes - Learn how pseudo-classes such as :active, :hover, and :visited select elements based on their state.

Legacy Browser Support

The obsolete alink attribute was supported by older browsers as a way to specify the active-link color for a document. Modern browsers may continue to recognize the attribute in older webpages for compatibility.

Browser recognition of the alink attribute does not make it valid modern HTML. New webpages should use the CSS :active pseudo-class when an active-link style is required.

For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.

Other obsolete HTML attributes historically used to control document and link colors include:

  • link - Historically used to set the color of unvisited hyperlinks.
  • vlink - Historically used to set the color of visited hyperlinks.
  • text - Historically used to set the document text color.
  • bgcolor - Historically used to set a background color.

Specifications

The alink attribute is listed among obsolete and non-conforming features in the WHATWG HTML Living Standard .