<BODY> Tag & its Attribute
HTML Tag <BODY>
<BODY> Acts as a container for the body of the document. It appears after the <HEAD> tag and is followed by the </HTML> tag. In HTML 3.2, the <BODY> tag also sets various color settings and background characteristics of the document; however, in HTML 4, those formatting attributes are deprecated in favor of Style Sheets.
Attribute of <BODY> Tag
- ALINK
- BACKGROUND
- BGCOLOR
- BGPROPERTIES
- CLASS
- ID
- LEFTMARGIN
- LINK
- SCROLL
- STYLE
- TEXT
- TITLE
- TOPMARGIN
- VLINK
ALINK
Indicates the color of hyperlink text while the text is selected. Color names can substitute for the RGB hexadecimal values.
<BODY BGCOLOR="#000ABC" TEXT="#000000"
LINK="#FFFFFF" VLINK="#999999" ALINK="#FF0000">
Possible Values
Color Name or Hexadecimal color code.
BACKGROUND
Specifies the relative or absolute location of an image file that tiles across the document's background.
<BODY BACKGROUND="images/slimey.gif">
Possible Values
Image file URL
BGCOLOR
Indicates the color of a document's background. Color names can substitute for the RGB hexadecimal values.
<BODY BGCOLOR="#000ABC" TEXT="#000000"
LINK="#999999" ALINK="#FF0000">
Possible Values
Color Name or hexadecimal color code.
BGPROPERTIES
Specifies the behavior of the background image (see the BACKGROUND attribute.) BGPROPERTIES= FIXED indicates that the background image remains in place as you scroll the document, creating a watermark effect.
<BODY BACKGROUND="waves.jpg"
BGPROPERTIES="FIXED">
Possible Values
Scroll, Fixed
CLASS
Indicates which style class applies to the <BODY> element.
<BODY CLASS="casual">
Possible Values
Any Class Name Defined by you.
ID
Assigns a unique ID selector to the <BODY> tag.
<BODY ID="dkm">
Possible Values
Any id name that you define.
LEFTMARGIN
Specifies the width (in pixels) of a margin of white space along the left edge of the entire document.
<BODY LEFTMARGIN="30">
Possible Values
Value in Pixel or Percentage.
LINK
Indicates the color of hyperlink text within the document, which corresponds to documents not already visited by the browser. Color names can substitute for the RGB hexadecimal values.
<BODY BGCOLOR="#000ABC" TEXT="#000000"
LINK="#FFFFFF" VLINK="#999999"
ALINK="#FF0000">
Possible Values
Color Name or hexadecimal color code.
SCROLL
Indicates whether scrolling is possible within the document body.
<BODY BGCOLOR="silver" SCROLL="NO">
Possible Values
Yes or No
STYLE
Specifies Style Sheet commands that apply to the document body.
<BODY STYLE="background: red">
Possible Values
CSS Properties with value.
TEXT
Indicates the color of normal text within the document. Color names can substitute for the RGB hexadecimal values.
<BODY BGCOLOR="#000ABC" TEXT="#000000"
LINK="#FFFFFF" VLINK="#999999"
ALINK="#FF0000">
Possible Values
Color Name or hexadecimal color code.
TITLE
Specifies text assigned to the tag. You might use this attribute for context-sensitive help within the document. Browsers may use this to show tool tips.
<BODY TITLE="Document body">
Possible Values
Any Text Message.
TOPMARGIN
Specifies the size (in pixels) of a margin of white space along the top edge of the entire document.
<BODY TOPMARGIN="10">
Possible Values
Value in Pixel or Percentage.
VLINK
Indicates the color of hyperlink text within the document, which corresponds to documents already visited by the browser. Color names can substitute for the RGB hexadecimal values.
<BODY VLINK="#999999">
Possible Values
Color Name or hexadecimal color code.