sound advice, your web design resource logo Home exchange links about us anti-spam pevention our web hosting company
 
search our websitesearch the internet

Tell a friend:

Index: Website Creation

Contains HTML tips, guides to forms, CSS, Java, forms, CGI, image tools, image galleries, website management tools and more!


Resource Guide To - Website Development & Design

Index 4:  All About Text & Style Sheets, CSS

 

Dealing With Font: Coloring Your Links

Controlling the appearance of links in a document is usually of personal choice. Who really decides how links should be presented in a document?

From the web master's viewpoint, link appearance is an extension of the document appearance, and should be controlled by the author. While HTML gives the author limited control over link presentation, the author should be able to define link appearance as part of the overall document format.

Most browsers let the reader determine link colors and appearance, including things like underlines and possibly font control. Readers know what they like to look at; they should be able to determine how links are presented.

Not only do browsers let users pick the link appearance, they also let the user force the browser to use their choices, even if an author specifies otherwise. Fortunately, this "force" option is turned off by default, so most users will allow an author's choices to be used.

Controlling link appearance

Since there is a good chance that you'll get to have a say in the way you present your links, you should know how to control their appearance. Within the bounds of HTML, the only thing you can control about your links is their color. You control those colors, not from within the <A> tag, but by adding a few attributes to the <BODY> tag.

Every link in your document exists in one of three states: unvisited, active, or visited. Unvisited tags have never been selected by the user, either in the current browser session, or as far back as the browser can tell in its history list. Active links are in the process of being visited, with the browser contacting the associated server for the specified resource. Depending on the speed of your connection and the server, a link may only be active for a fraction of a second. Visited links, of course, have been visited either in the current browser session or somewhere in the browser's history file.

Specifying link colors

You can assign a different color to each of these link states using attributes of the <BODY> tag. The LINK attribute defines the color of unvisited links; ALINK attribute controls active link colors; and VLINK sets the color of visited links. These colors apply to all the links in the document; it is not possible to make different links have different colors, at least with plain HTML.

To use these attributes, add them to the <BODY> tag. You don't need to add them all; it is perfectly fine to define one color while letting the others default to the browser or user defaults. The value is either a color name or a hexadecimal RGB color value.

For example, to set your unvisited links to blue and your visited links to fuchsia:

  <BODY LINK="blue" vlink="fuchsia">

Active links would use the default color. The same specification using RGB color values would be:

  <BODY LINK="#0000FF" VLINK="#FF00FF">

Changing link colors is easy. Changing link colors to the right color is much harder. In general, choose common colors that are likely to display correctly on the broadest range of browsers and displays. Avoid subtle changes in color between visited and unvisited links, since many users will not be able to tell the difference. Finally, choose colors that enhance the appearance of your pages without being distracting or annoying.

<< BACK


 
© Copyright FinalHost.com -all rights reserved