In your <BODY> tag you can set a background colour or image (also called wallpaper) and the colour of text to be used in your HTML document. Colours are set using hexadecimal (scale of 16) numerals preceeded by the hash mark (#). The format is #RRGGBB, standing for the 256 values of Red(RR) Green(GG) and Blue(BB). Here are some examples:
This colour value | is... |
#FFFFFF | WHITE (RED = FF, GREEN = FF, BLUE = FF) |
#000000 | BLACK (RED = 0, GREEN = 0, BLUE = 0) |
#00FFFF | CYAN (No RED, maximum GREEN and BLUE) |
#66FFCC | PALE GREEN (Half RED, maximum GREEN, lots of BLUE) |
#FF0000 | RED (All RED, no GREEN or BLUE) |
#999999 | GREY (Equal values of RED, GREEN & BLUE) |
Equal values from #111111 to #EEEEEE will always give grey, the lower the values the darker the shade.
As well as specifying an individual colour by its hex reference, you can use the 16 standard colours mentioned earlier in the chapter on Text Appearance. To remind you, they are:-
Black | Maroon | Green | Olive |
Navy | Purple | Teal | Grey |
Silver | Red | Lime | Yellow |
Blue | Fuschia | Aqua | White |
This colour name | is... |
WHITE | WHITE |
BLACK | BLACK |
BLUE | BLUE |
GREEN | GREEN |
RED | RED |
FUSCHIA | FUSCHIA |
The colours that can be specified in the BODY tag are:
Background Colour (<BODY
BGCOLOR="#RRGGBB">)
This is the colour that will be displayed in the background providing no image
has been specified as wallpaper.
Text Colour (<BODY
TEXT="#RRGGBB">)
This sets the colour of the text to be used in the document. It can be
overridden with an individual Font Colour (<FONT
COLOR="#RRGGBB">) tag.
Link Colour (<BODY
LINK="#RRGGBB">)
All Anchor links to other parts of your document or to other URLs are
highlighted (and usually underlined) so this option allows you to set the
colour for that highlighting.
Visited Link Colour (<BODY
VLINK="#RRGGBB">)
Having visited another part of the document or URL most browsers remember this
so this option allows you to set the remembered link colour.
Active Link Colour (<BODY
ALINK="#RRGGBB">)
When clicking on a link it will change colour whilst your mouse button is held
down so this option allows you to set that particular colour.
It isn't necessary for all these to be different colours, all the Link Colours can be the same if you wish, and can be the same as the Text Colour. The Background Colour must be different though as otherwise you'd never be able to read a word!
Tiled Background Image or
Wallpaper (<BODY BACKGROUND="URL">)
This will load the image found at the particular URL location and tile it in
the background. Until it has loaded the colour specified by BGCOLOR will be
displayed. Most browsers allow you to switch off loading of images and/or
backgrounds in which case the BACKGROUND image won't load so you must be
careful to ensure that your text will show up against the Background Colour. If
your Background Colour is white, your Background Image is dark and your text
colour is light, then if the Background Image isn't loaded the text will be
almost impossible to read so set your Background Colour wisely!
It is not necessary to include
the word "BODY" more than once in the command. For example, the BODY
tag for this page is:
<BODY BGCOLOR="#FCFCDC" TEXT="#703038"
LINK="#703038" ALINK="#703038"
VLINK="#703038">.