Section 3.8. The Document Body


3.8. The Document Body

The document body is the meat of the matter. It's where you put the contents of your document. The beginning <body> and end </body> tags delimit the document body.

3.8.1. The <body> Tag

Within HTML 4 and XHTML, the <body> tag has a number of attributes that control the color and background of your document. Various browsers have extended the tag to give even greater control over your document's appearance.

<body>

Function

Defines the document body

Attributes

alink , background , bgcolor , bgproperties , class , dir , id , lang , leftmargin , link , onBlur , onClick , onDblClick , onFocus , onKeyDown , onKeyPress , onKeyUp , onLoad , onMouseDown , onMouseMove , onMouseOut , onMouseOver , onMouseUp , onUnload , style , text , title , topmargin , vlink

End tag

</body> ; may be omitted in HTML

Contains

body_content

Used in

html_tag



Anything between the beginning <body> and end </body> tags is called body content . The simplest document might have only a sequence of text paragraphs within the <body> tag. More complex documents might include heavily formatted text, graphical figures, tables, and a variety of special effects.

Because the browser can infer the position of the <body> and </body> tags, they can safely be omitted from an HTML, but not an XHTML, document. Like the <html> and <head> tags, we recommend that you include both the <body> and </body> tags in your HTML documents, too, to make them more easily readable and maintainable .

The various attributes for the <body> 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; the class and style attributes for CSS in Chapter 8; JavaScript stylesheets and the programmatic attributes (the "on-event" ones) in Chapter 12; the language attributes ( dir and lang ) earlier in this chapter; and the identification attributes ( id and title ) in Chapter 4. [The dir attribute, 3.6.1.1] [The lang attribute, 3.6.1.2] [The id attribute, 4.1.1.4] [The title attribute, 4.1.1.5]

3.8.2. Frames

The HTML and XHTML standards define a special type of document in which you replace the <body> tag with one or more <frameset> 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 11.



HTML & XHTML(c) The definitive guide
Data Networks: Routing, Security, and Performance Optimization
ISBN: 596527322
EAN: 2147483647
Year: 2004
Pages: 189
Authors: Tony Kenyon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net