English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML: <body> Tag

The HTML <body> tag defines the main content of an HTML document or part of an HTML document, which will be visible directly on your webpage. This tag is also commonly referred to as the <body> element.

Online example

A simple HTML document containing the minimum necessary tags:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Document title</title>
</head>
 
<body>
Document content......
</body>
 
</html>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All major browsers support the <body> tag.

Definition and usage of the tag

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

The HTML <body> element is located within the <html> tag.
The most common elements in the HTML <body> tag are: <h1>,《p》,《div》和《table》tags.

HTML 4.01 With HTML5The differences

In HTML 5 In, all body elements' 'presentation attributes' have been removed.

In HTML 4.01 In, all body elements' 'presentation attributes' are deprecated.

Attribute

AttributeValueDescription
alinkcolorHTML5 Not supported. HTML 4.01 Deprecated.    Specifies the color of active links in the document.
backgroundURLHTML5 Not supported. HTML 4.01 Deprecated. Specifies the background image of the document.
bgcolorcolorHTML5 Not supported. HTML 4.01 Deprecated. Specifies the background color of the document.
linkcolorHTML5 Not supported. HTML 4.01 Deprecated. Specifies the color of unvisited links in the document.
textcolorHTML5 Not supported. HTML 4.01 Deprecated. Specifies the color of all text in the document.
vlinkcolorHTML5 Not supported. HTML 4.01 Deprecated. Specifies the color of visited links in the document.

Global Attributes

<body> tag supports HTML Global Attributes.

Event Attributes

<body> tag supports HTML Event Attributes.

Related Articles

HTML Tutorial: HTML Elements

HTML DOM Reference Manual:Body Object