HTML <body> Tag

Description

The <body> HTML element is designed to store the contents of a web page (content) displayed in a browser window. The information that should be displayed in the document should be located exactly inside the <body> container. This information includes headings, paragraphs, hyperlinks, images, forms, tables, lists, videos and so on.

Properties

Permitted Parents
It must be the second element of an <html> element.
Content
Block, inline and text
Start/End Tags
Start tag: optional, End tag: optional

Example

<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>

Attributes

Attribute Definition
background Specifies the URI/URL of a background image. This attribute is now deprecated.
text Specifies the URI/URL of a background image. This attribute is now deprecated.
link Specifies the color of unvisited hyperlink text. This attribute is now deprecated.
alink Specifies the color of active hyperlink text (i.e. when the user clicks on it). This attribute is now deprecated.
vlink Specifies the color of visited hyperlink text. This attribute is now deprecated.

Global Attributes

The <body> tag also supports the Global Attributes in HTML5

Event Attributes

The <body> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
Yes1211YesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
Yes184YesYesYes