HTML 5: The Markup Language

bodydocument body # T

The body element represents the body of a document (as opposed to the document’s metadata).

Content model #

Attribute model #

Element-specific attributes #

onafterprint = string
onbeforeprint = string
onbeforeunload = string
onhashchange = string
onmessage = string
onoffline = string
ononline = string
onpopstate = string
onredo = string
onresize = string
onstorage = string
onundo = string
onunload = string

Tag omission #

A body element's start tag may be omitted if the first thing inside the body element is not a space character or a comment, except if the first thing inside the body element is a script or style element.

A body element's end tag may be omitted if the body element is not immediately followed by a comment and the element is either not empty or its start tag has not been omitted.

Permitted contexts #

Typical default display properties #

body {
display: block;
margin: 8px; }
body:focus {
outline: none; }