HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

body

Description

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

Syntax

HTML

<body attribute-name="attribute-value"></body>

Attributes

Global

NameValueDescription
onafterprintstringHandles the event after printing
onbeforeprintstringHandles the event before printing
onbeforeunloadstringHandles the event when the page is about to be unloaded, in case the page would like to show a warning prompt
onhashchangestringHandles the event when the fragment identifier part of the document's current address changes
onmessagestringHandles the event when the object receives a message
onofflinestringHandles the event when the network connections fails
ononlinestringHandles the event when the network connections returns
onpagehidestringHandles the event when the page's entry in the session history stops being the current entry
onpageshowstringHandles the event when the page's entry in the session history becomes the current entry
onpopstatestringHandles the event when the user navigates the session history
onredostringHandles the event when the user goes forward in the undo transaction history
onresizestringHandles the event when the page is resized
onstoragestringHandles the event when storage occurs
onundostringHandles the event when the user goes backward in the undo transaction history
onunloadstringHandles the event when the page is going away

CSS

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

Examples

1 · onafterprint

2 · onbeforeprint

3 · onbeforeunload

4 · onhashchange

5 · onmessage

6 · onoffline

7 · ononline

8 · onpagehide

9 · onpageshow

10 · onpopstate

11 · onredo

12 · onresize

13 · onstorage

14 · onundo

15 · onunload

16 · CSS