Back to Section Main

If you'd like to dress up your page a little bit, you can change the default colors of your text, links, and background by adding attributes (options) to the BODY tag, or you can change the color of your text temporarily in the BODY by using the COLOR attribute of the FONT tag.

You also have the ability to specify an image to be used as the background for your page by using the BACKGROUND attribute of the BODY tag. When an image is used as a background, it automatically repeats (tiles) itself in order to fill up the browser window with that image.

NOTE: When using a background image on your page, take special care when selecting text and link colors in order to make sure that they are readable against your background image. Also note that people visiting your page may have changed the display options on their browser, so they may not see your colors as you intended.

The tags listed below allow you to add color and backgrounds to your page.

HTML Tag Attributes (options) Description
BODY TEXT="#xxxxxx|colorname"
LINK="#xxxxxx|colorname"
VLINK="#xxxxxx|colorname"
ALINK="#xxxxxx|colorname"
BGCOLOR="#xxxxxx|colorname"

Prodigy IE Netscape Mosaic

TEXT specifies the color of the text to be used on your page. LINK specifies the color used to identify hypertext links. VLINK specifies the color used for links that have already been visited. ALINK is not used much, but specifies the color of a link when it is active (clicked on). BGCOLOR specifies the color to be used for the background of your page.

#xxxxxx represents the RGB Hex code for the color you'd like to use. For example #ff0000 is red, and #0000ff is blue. colorname represents a Netscape name for a color, for example red, or blue.

NOTE: All the browsers tested support RGB hex codes for specifying colors (in the form of #xxxxxx), but Interenet Explorer and Mosaic only support a few colornames. Because of this, I'd recommend that you use the RGB color codes so that more visitors to your page can see your colors as you intended them. Also note that each of the browsers tested will display the same color slightly different.
<BODY TEXT="#blue" link="#000099" VLINK="#00ff00" ALINK="#yellow" BGCOLOR="#ffffff" >

Here's a sample of a page with a black background, blue text, red unvisited links, green visited links, and yellow active links.

Notice how the blue is a little hard to read against the background color. This is something to consider when selecting colors for your page.
BACKGROUND="filename" Specifies an image to be used to tile on the background of your page.

NOTE: When using background images, be selective when choosing text and link colors for your page. Try to select colors that will be readable against the background. Notice how hard it is to read the text in the example below.
FONT SIZE="n|+n|-n"

Prodigy IE Netscape

Allows you to temporarily change the size of the text in the body of your page.

For further details on changing text size, see the Controlling Text Size and Formatting page.

NOTE: Although three of the four browsers tested support this tag, each of them displays font sizes slightly different.
COLOR="#xxxxxx|colorname"

Prodigy IE Netscape

Temporarily overriding the text color in the body of your page is the same as specifying a TEXT or LINK color (see above for more details). The FONT tag requires an ending </FONT> tag.

NOTE: Of the four browsers tested, only Mosaic does not provide support for this option. Also, Microsoft's Internet Explorer v2.x supports far fewer colornames than the remaining two.
<FONT COLOR="#0000ff">Here's an</FONT>
<FONT COLOR="#ff0000">example of</FONT>
<FONT COLOR="#00ffff">changing</FONT>
<FONT COLOR="#228b22">text colors.</FONT>

Here's an example of changing text colors.


©1999-2001 Prodigy Communications Corporation | Privacy Policy | Trademark Notices
Jump to top of page