Dr. John's

Eazy-Peazy Guide to HTML

by John F. Barber  

Body Attributes

Any browser will automically define the color for any links displayed on your WWW page, as well as the background color for that page. Or, you can customize each of these aspects of your WWW page.

This customization is achieved in the body tag through the use of attributes. Using body attributes in association with the body tag allows you to define whether your WWW document will display a background color or a background image, define the color of the text, and define the colors of any links you wish to include. You can use the attribute tags illustrated below to customize the look of your WWW documents.

Body Attributes: How They Work
BGCOLOR
Bgcolor (BackGround COLOR) allows you to define a background color for your WWW document. To experiment with changing the background color of a WWW document, use the Background Example page.

Choose "Color" in the menu to the left for more information on using color in your WWW documents.
The bgcolor attribute can be defined inside the <body> start tag either as a name
<body bgcolor="yellow">
or a hexidecimal code.
<body bgcolor="#FFFF00">
Note: The desired color in each example ("yellow" and "#FFFF00") should be enclosed in quote marks as shown here, and above.
BACKGROUND
Background allows you to display an image (a .jpg or .gif file) as the background of your WWW document. Click here for an example. Note: The body background attribute ("image.gif") should be enclosed in quote marks as indicated below.
<body background="image.gif">
TEXT COLOR
TEXT COLOR allows you to define the color of the text in your WWW document. Note: The text color attribute (red) should be enclosed in quote marks as indicated below.
<body text color="red">This text is red.

Appearance in your WWW document:
This text is red.
LINK
By default, all browsers show links in blue. If you wish a different color, LINK allows you to specifically define the color of links to new documents or additional information. Choose "Link" in the menu to the left for more information on defining links in your WWW documents. Note: The link color attribute (green) should be enclosed in quote marks as indicated below.
<body link="green">

All Together
Here are how all these attributes might look enclosed within the BODY tag.
<body bgcolor="yellow" text="red" link="green">
or
<body background="image.gif" text="red" link="green">