#### 28.2.1 Specifying link colors

If you really must specify link color for some reason, always use the attributes intended for this purpose, either in the <body> tag or in CSS (see §31. Setting up CSS for HTML). You must specify three color values: for unvisited links, for active (already selected) links, and for visited links. For example:

    <body link="#0000ff" alink="#ff0000" vlink="#800080" >

The defaults of blue for link and purple for vlink (the default for alink varies) are best left alone unless you have a compelling reason to use something else. An alink is in an “active” state only while the mouse is clicked on it with the button held down. The rest of the time, it is either unvisited or visited.

Set via <body> tag

You can set link appearance in the attributes for the <body> tag. For example:

    [Attributes]
    ; link = hyperlink active color,
    ; alink = hyperlink color when clicked,
    ; vlink = visited hyperlink color, and
    ; #...... = your hex color for any of these
    body= bgcolor="#FFFFE1" text="#000080" link="#008020" vlink="#804000"

Keep all attributes for a given element on one line, regardless of line length.

Set via CSS

In CSS (browser-dependent at present) you could use, for example:

    a:link { color: blue }
    a:active { color: red }
    a:visited { color: #800080 }

To override CSS-defined colors for some or all links, see §28.2.2 Specifying link class.

Previous Topic: 28.2 Specifying link appearance

Next Topic: 28.2.2 Specifying link class

Parent Topic: 28.2 Specifying link appearance

Sibling Topics:

28.2.2 Specifying link class

28.2.3 Assigning link attributes with PI markers

28.2.4 Specifying link properties with macros

28.2.5 Replacing problem characters in links

28.2.6 Forcing link text to lowercase

Table of Contents • Index