Tag <body> HTML Reference



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>

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

1. Definition and Usage

The <body> tag defines the document's body.

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


2. Differences Between HTML 4.01 and HTML5

All layout attributes is removed from HTML5.

All layout attributes is deprecated in HTML 4.01.


3. Optional Attributes

DTD indicates in which HTML 4.01/XHTML 1.0 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 an active link in a document
TF
background URL Deprecated. Use styles instead.
Specifies a background image for a document
TF
bgcolor rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the background color of a document
TF
link rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the default color of unvisited links in a document
TF
text rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of the text in a document
TF
vlink rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of the visited links in a document
TF

4. Standard Attributes

The <body> tag supports the Standard Attributes in HTML.


5. Event Attributes

The <body> tag also supports the Standard Event Attributes in HTML.


Relative articles