Summary -

In this topic, we described about the <body> tag along with detailed example.

The Body sections contain the actual content area of a webpage structure. The <body> tag is used to declare the main content section of the HTML document. The <body> tag is placed after the document's <head> tag closed.

The document's content inserted between the opening and closing tags <body></body>, will be treated as HTML document body. Normally one <body> element per one HTML document.

It should start immediately after the closing head tag and end directly before the closing html tag. All layout attributes from HTML 4.01 are removed in HTML5.

Syntax -

<body>.. text/tags here.. </body>

Optional Attributes -

AttributeDescriptionValues
AlinkSpecifies the color of the active link for the HTML documentColor
BackgroundSpecifies the background image for the HTML documentURL
BgcolorSpecifies the background color for the HTML documentColor
LinkSpecifies the unvisited links color for the HTML documentColor
TextSpecifies the text color for the HTML documentColor
VlinkSpecifies the visited links color for the HTML documentColor

Example -

<!DOCTYPE html>
<html>
	<head>
		<title> Body element example.. </title>
	</head>
	<body>
		<!--  document body here -->
		<p> Document body display </p>
	</body>
</html>