Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

19 Creating HTML links > 19.2 Specifying link appearance > 19.2.1 Specifying link colors


19.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 §22 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 §19.2.2 Specifying link class.



19 Creating HTML links > 19.2 Specifying link appearance > 19.2.1 Specifying link colors