HTML <body> Tag

The <body> tag defines a web page content (text, images, links etc.). It is placed inside the <html> element, after the <head> tag. In an HTML document, we can use only one <body> tag.

Syntax

The <body> tag comes in pairs; its content is written between the opening (<body>) and the closing (</body>) tags.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    Content of the document
  </body>
</html>

Result

Attributes

Attributes Value Description
alink color Defines the color of the active link.
Not used in HTML5.
background URL Defines background image.
Not used in HTML5.
bgcolor color Defines the background color.
Not used in HTML5.
link color Defines the color of unvisited links.
Not used in HTML5.
text color Defines the color of the text in a document.
Not used in HTML5.
vlink color Defines the color of the visited link.
Not used in HTML5.

The <body> tag supports the Global Attributes and the Event Attributes.

Browser support