HTML <body>Tag


Examples

A simple HTML document, containing as few required tags as possible:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Document title</title> </head> <body>Document content......</body> </html>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <body> tag.


Tag Definition and Usage Instructions

The <body> tag defines the body of the document.

The <body> element contains all the content of the document (such as text, hyperlinks, images, tables, and lists, etc.).


Difference between HTML 4.01 and HTML5

In HTML5, all "presentation attributes" of the body element have been removed.

In HTML 4.01, all "presentation attributes" of the body elementare deprecated。


Attributes

Attribute Value Description
alink color Not supported in HTML5. Deprecated in HTML 4.01.Specifies the color of active links in the document.
background URL Not supported in HTML5. Deprecated in HTML 4.01.Specifies the background image of the document.
bgcolor color Not supported in HTML5. Deprecated in HTML 4.01.Specifies the background color of the document.
link color Not supported in HTML5. Deprecated in HTML 4.01.Specifies the color of unvisited links in the document.
text color Not supported in HTML5. Deprecated in HTML 4.01.Specifies the color of all text in the document.
vlink color Not supported in HTML5. Deprecated in HTML 4.01.Specifies the color of visited links in the document.


Global Attributes

The <body> tag supportsthe Global Attributes in HTML。


Event Attributes

The <body> tag supportsthe Event Attributes in HTML。


Related Articles

HTML Tutorial:HTML Elements

HTML DOM Reference:Body Object

Other Extensions