Latest web development tutorials

HTML <body> tag

Examples

A simple HTML document that contains the minimum required tags:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文档标题</title>
</head>

<body>
文档内容......
</body>

</html>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the <body> tag.


Tag definitions and instructions

<Body> tag defines the body of the document.

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


Differences between HTML 4.01 and HTML5

In HTML 5, and removed all body elements "presentation attribute."

In HTML 4.01, the "presentation attribute" all body elements have been abandoned .


Attributes

属性 描述
alink color HTML5 不支持。 HTML 4.01 已废弃。 规定文档中活动链接的颜色。
background URL HTML5 不支持。 HTML 4.01 已废弃。 规定文档的背景图像。
bgcolor color HTML5 不支持。 HTML 4.01 已废弃。规定文档的背景颜色。
link color HTML5 不支持。 HTML 4.01 已废弃。规定文档中未访问链接的颜色。
text color HTML5 不支持。 HTML 4.01 已废弃。规定文档中所有文本的颜色。
vlink color HTML5 不支持。 HTML 4.01 已废弃。规定文档中已被访问链接的颜色。


Global Properties

<body> tag supports HTML global properties .


Event Properties

<body> tag supports HTML event properties .


related articles

HTML Tutorial: HTML elements

HTML DOM Reference: Body Object