Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
3.7 The Document Body
The document body is the meat of the matter; it's where you put the contents of your document. The
tag delimits the document body.3.7.1 The Tag
Within HTML 4.0, the
tag has a number of attributes that control the color and background of your document. Various browsers, as we'll see, have extended the tag to give even greater control over your document's appearance.Function:
Defines the document body
Attributes:
ALINK ONKEYPRESS
BACKGROUND ONKEYUP
BGCOLOR ONLOAD
BGPROPERTIES
ONMOUSEDOWN
CLASS ONMOUSEMOVE
DIR ONMOUSEOUT
ID ONMOUSEOVER
LANG ONMOUSEUP
LEFTMARGIN
ONUNLOAD
LINK STYLE
ONBLUR
TEXT
ONCLICK TITLE
ONDBLCLICK TOPMARGIN
ONFOCUS
VLINK
ONKEYDOWN
End tag:
; may be omitted
Contains:
body_content
Used in:
html_tag
Anything inside the
tag and its ending counterpart is calledMore complex documents will include heavily formatted text, graphical figures, tables, and a variety of special effects.
Since the position of the
and tags can be inferred by the browser, they can safely be omitted from the document. However, like the and tags, we recommend that you include the tags in your document to make them more easily readable and maintainable.The various attributes for the
tag can be loosely grouped into three sets: those that give you some control over the document's appearance, those that associate programmable functions with the document itself, and those that label and identify the body for later reference. We address the appearance attributes (alink, background, bgcolor, bgproperties, leftmargin, link, text, topmargin, and vlinklanguage attributes (dir and lang) earlier in this chapter in sections 3.5.1.1 and 3.5.1.2; and the identification attributes (id and title
) in [Text Basics, 4]
.
[The dir attribute, 3.5.1.1]
[The lang
attribute, 3.5.1.2]
[The id attribute, 4.1.1.4]
[The title attribute, 4.1.1.5]
3.7.2 Frames
HTML 4.0 defines a special type of HTML document in which you replace the
tag with one or more