Name

body — HTML 4.01 | HTML5

Synopsis

<body> . . . </body>

The body of a document contains the document’s content. Content may be presented visually (as in a graphical browser window) or aurally (by a screen reader). There may only be one body element in a document. In HTML documents, it is optional; in XHTML it is required.

Notes

All of the presentational attributes for the body are deprecated in (X)HTML and have been dropped from HTML5 in favor of style sheet controls.

Start/End Tags

HTML 4.01 and 5: Optional/Optional; XHTML: Required/Required

Attributes

Core, Internationalization, Events; plus onload and onunload

HTML5 Global Attributes; plus onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpagehide, onpageshow, onpopstate, onredo, onresize, onstorage, onundo, and onunload

alink="#rrggbb" or "color name"

Deprecated. Not in HTML5. Sets the color of active links (the color while the mouse button is held down during a click).

background="URL"

Deprecated. Not in HTML5. Provides the location of a graphic file to be used as a tiling graphic in the background of the document.

bgcolor="#rrggbb" or "color name"

Deprecated. Not in HTML5. Sets the color of the background for the document.

link="#rrggbb" or "color name"

Deprecated. Not in HTML5. Sets the default color for all the links in the document.

text="#rrggbb" or "color name"

Deprecated. Not in HTML5. Sets the default color for all the nonhyperlink and unstyled text in the ...

Get HTML & XHTML Pocket Reference, 4th 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.