The Document Body

The document body is the meat of the matter; it’s where you put the contents of your document. The <body> tag delimits the document body.

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.

Anything between the <body> tag and its ending counterpart, </body>, 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.

Since the position of the <body> and </body> tags can be inferred by the browser, they can safely be omitted from an HTML, but not an XHTML, document. Like the <html> and <head> tags, we recommend ...

Get HTML & XHTML: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.