|
The example of body tag in HTML
<html>
<head>
<title>HTML Body tag</title>
</head>
<body>
html tags in text information display here
</body>
</html>
The HTML body is used to define document part of HTML in webpage.
This document can combine hyperlink, text, information, images, list, colors, quote and all visible things.
Text or information written inside body tag only can visible to user. Rest of information cannot visible to user.
Body tag attribute
| Attribute |
Value |
Explaination |
| bgcolor |
Color |
Define document background color |
| text |
Color |
Define document text color |
| link |
Color |
Define color of links in document |
| vlink |
Color |
Define color of visited links |
| alink |
Color |
Define color of selected links |
| background |
URL |
Define URL of background image |
| bottommargin |
Number |
Define bottom margin |
| leftmargin |
Number |
Define left margin of document |
| marginheight |
Number |
Define hight margin of document |
| marginwidth |
Number |
Define width margin of document |
| rightmargin |
Number |
Define right margin |
| topmargin |
Number |
Define top margin |
Common Attribute of body Tag
| Attribute |
Value |
Explaination |
| id |
ID |
unique id document for element |
| class |
classname |
list of CSS classes |
| style |
StyleSheet |
associated style information of style tags |
| title |
Text |
information about an element shown on mouse over cursor |
| lang |
LanguageCode |
Language Code of the element |
| dir |
ltr rtl |
direction for weak/neutral text |
Events Attribute of body Tag
| Attribute |
Value |
Explaination |
| onload |
Event |
Event Fire on the document has been loaded |
| onunload |
Event |
Event Fire on the document has been removed or closed windows |
| onblur |
Event |
Event Fire on document lost the focus |
| onerror |
Event |
Event Fire on document get error |
| onfocus |
Event |
Event Fire on docuement got the focus |
| onresize |
Event |
Event Fire on docuement got resize window |
|