How do I set the colors for my web page? Is there a list of colors?

Most popular web browsers, including Netscape 1.1 or later and Microsoft Internet Explorer, now allow the web page designer to decide what colors should be used to display the page.

This is accomplished using attributes of the <BODY> tag. HTML authors who are unfamiliar with the <BODY> tag need to know that the <BODY>...</BODY> tags should enclose everything in the document except for the <TITLE> tag at the beginning. (The <TITLE> tag should be enclosed in a <HEAD> tag, although this is optional. For further details about the proper syntax of an HTML page, consult the w3 consortium web pages <URL:http://www.w3.org/>.)

The following short HTML document makes extensive use of this feature. Try pasting this HTML into a file and opening it with your web browser.

<HEAD>
<TITLE>Color Test</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF" 
         TEXT="000000" 
         LINK="00FF00" 
         VLINK="CC33FF"
         ALINK="FF0000">

<H1>Color Test</H1>
<P>
This page contains black text on a white background.
<a href="http://www.boutell.com/">Links</a> are
displayed in green. 
Once visited, links are displayed in yellow. When active,
links are be displayed in red.
<BODY>
The BGCOLOR attribute sets the background color. The TEXT attribute sets the text color. The LINK attribute sets the color for links. The VLINK attribute sets the color for links you have already visited, and the ALINK attribute sets the color for links that are active at that moment. If you set one of these attributes, it is important to set them all, to make sure the user's own defaults do not clash badly with the one attribute you have changed.

"Sure, but what do the numbers and letters mean?"

Those are hexadecimal digits: two digits for red, two digits for green, and two digits for blue. 00 is black (absence of color) and FF is maximum intensity.

Fortunately, you don't need to understand that. Just use Doug Jacobson's RGB Hex Triplet Color Chart <URL:http://www.phoenix.net/~jacobson/rgb.html>, which provides the appropriate values for lots of nifty colors.


World Wide Web FAQ