HTML/Elements/body

From W3C Wiki
< HTML‎ | Elements
Revision as of 14:43, 24 July 2011 by Plehegar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<body>

The <body> element represents the main content of the document.

HTML Attributes

  • onafterprint = string
    User printed current document.


  • onbeforeprint = string
    User requested printing of current document.


  • onbeforeunload = string
    Document is about to be unloaded.


  • onblur = string
    Document lost focus.


  • onerror = string
    Document failed to load properly.


  • onfocus = string
    Document received focus.


  • onhashchange = string
    Fragment identifier part of the document’s current address changed.


  • onload = string
    Document finished loading.


  • onmessage = string
    Document received a message.


  • onoffline = string
    Network connections failed.


  • ononline = string
    Network connections returned.


  • onpopstate = string
    User navigated session history.


  • onredo = string
    User went forward in undo transaction history.


  • onresize = string
    Document view was resized.


  • onstorage = string
    Storage area changed.


  • onundo = string
    User went backward in undo transaction history.


  • onunload = string
    Document is going away.


See also global attributes.

The following attributes are obsolete, and must not be used by authors: alink, bgcolor, link, marginbottom, marginheight, marginleft, marginright, margintop, marginwidth, text, vlink.

Examples

Example A

[try it]

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML Document</title>
</head>
<body>
<p>The HTML content</p>
</body>
</html>

Body01.png

HTML Reference

The HTML5 specification defines the <body> element in 4.4.1 The body element.