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
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; }
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
Links
Related
Elements
- !doctype
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- data
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hgroup
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- label
- legend
- li
- link
- main
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rb
- rp
- rt
- rtc
- ruby
- s
- samp
- script
- search
- section
- select
- slot
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- template
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr