files/en-us/web/html/reference/elements/body/index.md
The <body> HTML element represents the content of an HTML document. There can be only one <body> element in a document.
This element includes the global attributes, event attributes, and deprecated attributes:
[!NOTE] Each of the below event attribute names is linked to its equivalent {{domxref("Window")}} interface event. You can listen to these events using
addEventListener()instead of adding theoneventnameattribute to the<body>element.
onafterprint
onbeforeprint
onbeforeunload
onblur
onerror
onfocus
onhashchange
'#') character) of the document's current address has changed.onlanguagechange
onload
onmessage
onmessageerror
onoffline
ononline
onpageswap
onpagehide
onpagereveal
onpageshow
onpopstate
onresize
onrejectionhandled
onstorage
onunhandledrejection
onunload {{deprecated_inline}}
[!WARNING] Do not use these deprecated attributes; opt for the CSS alternatives listed with each deprecated attribute instead.
alink {{deprecated_inline}}
background {{deprecated_inline}}
bgcolor {{deprecated_inline}}
bottommargin {{deprecated_inline}}
leftmargin {{deprecated_inline}}
link {{deprecated_inline}}
rightmargin {{deprecated_inline}}
text {{deprecated_inline}}
topmargin {{deprecated_inline}}
vlink {{deprecated_inline}}
<html lang="en">
<head>
<title>Document title</title>
</head>
<body>
<p>
The <code><body></code> HTML element represents the content of an
HTML document. There can be only one <code><body></code> element in
a document.
</p>
</body>
</html>
{{EmbedLiveSample('Example')}}
{{Specifications}}
{{Compat}}