From http://www.w3schools.com (Copyright Refsnes Data)

HTML <body> tag


Example

A simple HTML document, with the minimum of required tags:

<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>

Try it yourself!


Definition and Usage

The body element defines the document's body.

The body element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <body> tag is supported in all major browsers.


Differences Between HTML and XHTML

All "presentation attributes" of the body element were deprecated in HTML 4.01, and are not supported in XHTML 1.0 Strict DTD.


Optional Attributes

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

Attribute Value Description DTD
alink rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of the active links in the document.
TF
background file_name Deprecated. Use styles instead.
An image to use as the background.
TF
bgcolor rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
The background color of the document.
TF
link rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of all the links in the document.
TF
text rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of the text in the document.
TF
vlink rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of the visited links in the document.
TF

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onload, onunload, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


From http://www.w3schools.com (Copyright Refsnes Data)