CodesJava

Easy learning with example program codes

Body HTML

HTML <body> Tag

The main content of an HTML document is defined inside the HTML <body> tag. Only the content inside the HTML <body> tag is meant to be displayed on the browser. The content can vary from simple text to paragraphs, headings, images, tables, links, videos, etc. It is placed after the <head> tag or between </head> and </html> tags. In an HTML document, the <body> tag is used only once and is a required tag for every HTML document.

Syntax:

<body>content</body>

Example:

<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
Hello World!!
</body>
</html>

Output:

Explanation:

In the above example, we have displayed an HTML document with some basic tags.

Tag specific Attributes:

AttributeValueUsesHTML5
alinkcolorTo specify the color of the active link in a document.Not supported in HTML 5.
backgroundURLTo specify the background image of the document.Not supported in HTML 5.
bgcolorcolorTo specify the background color of the content.Not supported in HTML 5.
linkcolorTo specify the color of the unvisited link.Not supported in HTML 5.
textcolorTo specify the color of the text in the document.Not supported in HTML 5.
vlinkcolorTo specify the color of the visited link.Not supported in HTML 5.
onloadTo call function on page loading.Supported in HTML 5.
onunloadTo call function when user leaves the page.Supported in HTML 5
onfocusTo call function when document receives focus by user.Supported in HTML 5
onblurTo call function when document loses focus by user.Supported in HTML 5

Global Attributes:

All the Global attributes are supported by the HTML <body> tag.

Event Attributes:

All the Event attributes are supported by the HTML <body> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera and Safari.

Please follow and like us:
error
Posted in HTML   









Copyright © 2019 CodesJava DMCA.com Protection Status