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 -
Attribute | Description | Values |
---|---|---|
Alink | Specifies the color of the active link for the HTML document | Color |
Background | Specifies the background image for the HTML document | URL |
Bgcolor | Specifies the background color for the HTML document | Color |
Link | Specifies the unvisited links color for the HTML document | Color |
Text | Specifies the text color for the HTML document | Color |
Vlink | Specifies the visited links color for the HTML document | Color |
Example -
<!DOCTYPE html>
<html>
<head>
<title> Body element example.. </title>
</head>
<body>
<!-- document body here -->
<p> Document body display </p>
</body>
</html>