96 Chapter 6 – Structural HTML Tags
Global Settings with the
TagWeb Design in a Nutshell, eMatter Edition
Global Settings with the
TagThe<body>tag, originally designed to delimit the body of the document, has
been extended to include controls for the backgrounds and text colors of a docu-
ment. These settings are global, meaning they will apply to the entire document.
Colors
You can use the<body>tag to set colors for the background and text elements
(see Table 6-1). Specified link colors apply to linked text, but also to the border
around linked graphics. (To learn how to specify color in HTML, see Chapter 5.)
A single<body> tag can contain a number of specific attributes, as shown here:
<BODY BGCOLOR="color" TEXT="color" LINK="color" VLINK="color"
ALINK="color">
Tiling Background Graphics
You’ve probably seen web pages that have a graphic image repeating behind the
text. These are calledbackground tiles,ortiling graphics, and they are added to
the document via the<body>tag using thebackgroundattribute and the URL of
the graphic as follows:
<BODY BACKGROUND="background.gif">
Any web-based graphic file format (such as GIF or JPEG) can be used as a back-
ground tile (some new browsers even support animated GIFs in the background).
Following are a few guidelines and tips regarding the use of background tiles:
- Use graphics that won’t interfere with the legibility of the text over it.
Table 6-1: Attributes for Specifying Colors with the <body> Tag
Page Element HTML TAG Description
Background
color
<BODY BGCOLOR="color"> Sets the color for the back-
ground of the entire page.
Regular text <BODY TEXT="color"> Sets the color for all the regular
text in the document. The
default color for text is black.
Links <BODY LINK="color"> Sets the color for hyperlinks.
The default color for links is
blue.
Visited link <BODY VLINK="color"> Sets the color for links that have
already been clicked. The
default color for visited links is
purple.
Active link <BODY ALINK="color"> Sets the color for a link while it
is in the process of being
clicked. The default color for an
active link is red.