body
The body HTML element represents the body of a document (as opposed to the document's metadata).
HTML
<body attribute-name="attribute-value"></body>
Attributes
Name |
Value |
Description |
onafterprint |
string |
Handles the event after printing |
onbeforeprint |
string |
Handles the event before printing |
onbeforeunload |
string |
Handles the event when the page is about to be unloaded, in case the page would like to show a warning prompt |
onhashchange |
string |
Handles the event when the fragment identifier part of the document's current address changes |
onmessage |
string |
Handles the event when the object receives a message |
onoffline |
string |
Handles the event when the network connections fails |
ononline |
string |
Handles the event when the network connections returns |
onpagehide |
string |
Handles the event when the page's entry in the session history stops being the current entry |
onpageshow |
string |
Handles the event when the page's entry in the session history becomes the current entry |
onpopstate |
string |
Handles the event when the user navigates the session history |
onredo |
string |
Handles the event when the user goes forward in the undo transaction history |
onresize |
string |
Handles the event when the page is resized |
onstorage |
string |
Handles the event when storage occurs |
onundo |
string |
Handles the event when the user goes backward in the undo transaction history |
onunload |
string |
Handles the event when the page is going away |
CSS
body {
display: block;
margin: 8px;
}
body:focus {
outline: none;
}
onafterprint
onbeforeprint
onbeforeunload
onhashchange
onmessage
onoffline
ononline
onpagehide
onpageshow
onpopstate
onredo
onresize
onstorage
onundo
onunload
CSS
Internal
External