HTML Body
|
The BODY of a document contains the document's content.
The content may be presented by a user agent (e.g. a browser)
in a variety of ways. For example, for visual browsers,
you can think of the BODY
as a canvas where the content appears:
text, images, colors, graphics, etc.
For audio user agents, the same content may be spoken.
Since
style sheets are now the
preferred way to specify a document's presentation, the
presentational attributes of BODY have been deprecated.
|
Both start and end tags for BODY may be omitted.
The key attributes are: BACKGROUND, BGCOLOR, TEXT, LINK, VLINK and
ALINK.
These can be used to set a repeating background image,
plus background and foreground
colors
for
normal text and
hypertext links.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<Head>
<TITLE>The WDVL: HTML 3.2</TITLE>
.. other head elements ..
</Head>
<Body Background = "/Images/margin.gif"
Bgcolor = "#ffffff"
Text = "#000000"
Link = "blue"
Vlink = "purple"
Alink = "red" >
.. other BODY elements ..
</Body>
</HTML>
The BODY attributes are deprecated in HTML 4.0:
- BACKGROUND
-
This attribute's value is the URI of the graphic that will be tiled as
the background of the page.
The user will not see this background for non-compliant browsers;
if image loading is turned off;
or if the user has overridden the background images in their preferences.
This background image
is used to tile the full background of the document-viewing area.
If the image you specify as a background has transparent areas,
the BGCOLOR will show through
(beware, this can show up as black on Macs).
- BGCOLOR
-
This attribute allows you to specify a solid background
color.
The color is specified using a hexadecimal code:
#RRGGBB
where RR, GG, BB are the hexadecimal digits specifying the
Red, Green, and Blue values of the color.
For example:
black = #000000
blue = #0000FF
red = #FF0000
orange red = #FF4500
white = #FFFFFF
If a background file specified in the Background attribute cannot be
found, the color specified by the BGCOLOR tag will be used.
This BGCOLOR will also be used if the user has auto load images off.
This BGCOLOR will also be used as a table border color
on Netscape for Windows.
This attribute sets the color of the background as "#rrggbb"
where "#rrggbb" is a hexadecimal red-green-blue triplet.
You need to also control the foreground to establish the proper
contrasts. The following
attributes are also recognized as part of the BODY tag.
- TEXT
-
This attribute is used to control the
color of all the normal
text in the document.
This basically consists of all text that is not specially
colored to indicate a link.
The format of TEXT is the same as that of BGCOLOR.
- VLINK
-
Visited link,
and ALINK stands for active link.
The default coloring of these is: LINK=blue,
VLINK=purple,
and ALINK=red.
Again the format for these attributes is the same as that
for BGCOLOR and TEXT.
Colors are given in RGB as hexadecimal numbers (e.g. "#C0FFC0") or as
one of 16 widely understood color names:
color=aqua> aqua, black, blue, gray, fuchsia, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow.
These colors were originally picked as being the standard 16 colors
supported with the Windows VGA palette.
Most elements that can appear in the document BODY fall into one
of two groups: block level elements which cause paragraph breaks,
and text level elements which don't. Note that block elements
generally act as containers for text level and other block level
elements (excluding headings and address elements), while text level
elements can only contain other text level elements. The exact model
depends on the element.
Common block level elements include
- H1 to H6 (headers),
- P (paragraphs),
- LI (list items), and
- HR (horizontal rules).
Common text level elements include
|