HTML The Definitive Guide (26 page)

Read HTML The Definitive Guide Online

Authors: Chuck Musciano Bill Kennedy

BOOK: HTML The Definitive Guide
9.68Mb size Format: txt, pdf, ePub

Chapter 3

Anatomy of an HTML

Document

 

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 called
body content
. The simplest HTML document might have only a sequence of text paragraphs within the tag.

More 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 vlink
) in Chapter 5, Rules, Images, and Multimedia
; the class and style attributes for cascading style sheets in
Chapter 9, Cascading Style Sheets
; JavaScript style sheets and the programmatic attributes (the "on-event" ones) in
Chapter 13, Executable Content; the

language 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 tags. This so-called
frame
document divides the display window into one or more independent windows, each displaying a different document. We thoroughly describe this innovation in
Chapter 12
.

3.6 The Document Header

3.8 Editorial Markup

Other books

The Last Deep Breath by Tom Piccirilli
Spring Will Come by Ginny Dye
Balthasar's Odyssey by Amin Maalouf
Gossamer Axe by Baudino, Gael
The Vagabond Clown by Edward Marston
Flags of Sin by Kennedy, J. Robert
A Mighty Endeavor by Stuart Slade
The Blue Fox by Sjon