The <BODY> tag is the block
formatting element that surrounds all other homepage content. It is
also where you'll set the colors (or the image) for the background, text,
and links. Don't forget to end your page with a
</BODY> tag followed by a
</HTML> tag.
To have an image as a tiled background, you just have to add the
BACKGROUND attribute to the
BODY tag, like this:
<BODY BACKGROUND="image.gif">
The background of the page will be the image in the file "image.gif",
tiled over and over to fill the window.
Specifying Colors
To specify a background color, you would do the following:
<BODY BGCOLOR="#000000">
The six digit number (with a "#" in front) is a code for the color
black. It's called an RGB
value. It's divided into three parts. The first two digits
indicate the value for Red, using a
hexadecimal value. The second two digits are for the Green
value, and the last two are for the Blue value. The color white
would be written #FFFFFF, the highest value for each of the
three components.
Color names and sRGB values
 |
Black = "#000000" |
 |
Green = "#008000"
|
 |
Silver = "#C0C0C0" |
 |
Lime = "#00FF00"
|
 |
Gray = "#808080" |
 |
Olive = "#808000"
|
 |
White = "#FFFFFF" |
 |
Yellow = "#FFFF00"
|
 |
Maroon = "#800000" |
 |
Navy = "#000080"
|
 |
Red = "#FF0000" |
 |
Blue = "#0000FF"
|
 |
Purple = "#800080" |
 |
Teal = "#008080"
|
 |
Fuchsia = "#FF00FF" |
 |
Aqua = "#00FFFF"
|
For more information on selecting colors check my
Resource Page under "Color Selection".
You can specify the text color, TEXT;
the color of a hyperlink, LINK; a
hyperlink that you've already visited, VLINK;
and a hyperlink you've just "activated", ALINK.
(Note: If you're using a background image it's also good practice to
specify a background color, for those viewers browsing with images turned
off, that approaches the overall color of the background image.)
Here's how the BODY tag for this
page looks:
<BODY BGCOLOR="#FAF0E6" TEXT="#000000"
LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
|