This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?

Web Publishing

Specifying Colors

Colors add a lot of personality to your documents. Not all Web browsers will be capable of viewing your exact text color combinations, in most cases they will revert to that browser's default colors with no ill effects. Be aware, also, that color-blind users will be unable to decipher pages with certain color combinations. Testing is required when you choose colors to ensure that the documents look satisfactory from all views. This guarantees that a wider audience will be able to appreciate your talents.

return to topDefinitions

Color Attributes used with the <Body> Tag

For an example of the above attributes as they are used in your document, see the Syntax section.

BGCOLOR Applies a solid background color behind the text of your page
TEXT The color of your text
LINK The color of a link before you visit it
VLINK The color of a link after you visit it (Visited Link)
ALINK The split-second color of a link when you select it (Active Link)
BACKGROUND A graphical background created by tiling an image of your choice across the screen

return to topHexadecimal Numbers

Color codes are made up of three 2-digit codes with each 2-digit code representing the amount of Red, Green, or Blue combined to make a color. A color that starts with 00 has no red and a color that ends in 00 has no blue. A color that starts with FF has full red and a color with FF as its middle pair of digits has full green. There now several utilities for most computers to determine color codes.

For example, the hex number for blue is 0000FF. Use the pound sign (#) with the hex number enclosed in quotes (e.g., "#0000FF").

Below are some commonly used color numbers.

Hexadecimal Color Numbers

Black "#000000"
Blue "#0000FF"
White "#FFFFFF"
Red "#FF0000"
Green "#00FF00"
Magenta "#FF00FF"
Yellow "#FFFF00"


return to topSyntax

Here is a simple example page of the color and background attributes at work within the <BODY> tag:


<TITLE>Expressing Yourself With Color</TITLE>

<BODY BGCOLOR="#000000" TEXT="#FFFF00" LINK="#FF0000" VLINK="#FFFFFF" ALINK="#00FF00" BACKGROUND="path/filename" >

<H1>Expressing Yourself With Color</H1>

In this example, the background is black and the text is yellow. Links are red, visited links are white but turn green when first selected.


The color and background attributes above control background, text and link colors for the entire document. Note that you can use one or all of the attributes within the <BODY> tag. The order they are listed in is not important. Note that hexadecimal color numbers were used instead of color names. When using color names, you would replace the hexadecimal number with the color name of your choice (no pound sign, no quotes).

Notice the BACKGROUND attribute used in the above example. This attribute is used when you want to use an image from a graphic file, rather than a color name or number, for your background. The phrase "path/filename" refers to the background image you choose. You must insert the folder or directory path and filename for your background between the quotes after the BACKGROUND attribute. The BACKGROUND attribute is explained in more detail in HTML Codes for Colors and Backgrounds.

Excellence. Our Measure. Our Motto. Our Goal.