Description

The <body> element represents the main content of the document. It typically wraps around all of the content that will be displayed on screen, such as headings, paragraphs, hyperlinks, images, forms, tables, lists, videos and so on.

The following table summarizes the usages context and the version history of this tag.

Placement:Block
Content:Block, inline, and text
Start/ End Tag:Start tag: optional , End tag: optional
Version:2, 3.2, 4, 4.01, 5

Syntax

The basic syntax of the <body> tag is given with:

HTML/XHTML:* <body> ... </body>

The example below shows the <body> tag in action.

<!DOCTYPE html>
<html>
<head>
    <title>HTML Document</title>
</head>
<body>
    <p>Hello World!</p>
</body>
</html>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <aside> tag.

Global Attributes

Like all other HTML tags, the <body> tag supports the global attributes in HTML5.

Event Attributes

The <body> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<body>YesYesYesYesYes