Body

The   element surrounds all of a page's content that will actually be rendered on the web page. It is possible to specify a background color or image for the page by using the proper CSS property.

Example code
To apply this in an HTML document, use:

Attributes
As of HTML 4.0, all presentational attributes on the body are deprected in favor of CSS.


 * Global HTML attributes
 * HTML 4 & 5: onload, onunload
 * Deprecated in HTML 4: background, text, link, vlink, alink
 * HTML 5 only: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onmessage, onoffline, ononline, onpagehide, onpageshow, onpopstate, onredo, onresize, onscroll, onstorage, onundo

Rendering
Most graphical web browsers add an 8 pixel margin around the body contents.

Typical CSS representation:

Coding rules
The element is the second element inside the  element. (The element is the first one.) Inside the  element, only elements from the Flow content category are allowed. The element itself belongs to the Sectioning root category.

Both the start and end tags are optional. The element is automatically generated when the tags are not used.