The <body> tag defines the "canvas" of the page. This is the place, on the reader's screen, where all text and graphics appear. It is possible to have multiple canvases by using frames or layers.
It should be noted that if you are not in the habit of using the <body> tag, that you consider it, if only for the range of attributes and the features that it offers.
Many of the attributes that were useful before have now been deprecated in favour of the stylesheet equivalent. For purposes of this page, examples of their use has been moved from the <body> tag for this page to "static" examples beside the attributes themselves.
It must be noted that until stylesheets are fully supported, deprecated attributes will continue to be supported and backwards compatibility will probably continue for several generations of browsers.
| none |
BODY, without any attributes is required to define the section of the document prepared for the reader. It works in conjunction with <html> and <head>
|
alink=
deprecated
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
This is one of the attributes that allows you to control the colour of text. The "alink" attribute deals specifically with "Active" links.
Hold the mouse button down on this link to see an active link color. Active Link
|
| "#rrggbb"
 |
0.9 |
1.2 |
|
|
|
|
this is six hexadecimal numbers that stipulates a specific colour from a palette of 32768 colours. The colours are specified in rr= red, gg= green, bb= blue. According to Microsoft, the "#" sign is optional.
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
| "colorname"
 |
0.9 |
1.2 |
|
|
|
|
in addition to the #rrggbb combination above, specific colours can be specified by name. Supported colours are:
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
background=
deprecated
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
specifies a *.gif or *.jpeg file that, when tiled, creates a background to the web page. The only argument to the attribute is "URL" or "filename".
The background on this page is very interesting. View the source file to see that the background has been set to a file "blue.jpg". This overprints the background colour set in the body tag (bgcolor="navy"). When a table (in Netscape) is placed on top of the background file, it "etches" through the background file and shows the bgcolor. I then set the table background (bgcolor=) to white. This forces the table borders to "bleed" through the background file.
|
bgcolor=
deprecated?
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
In the HTML 4.0 specification, under the <body> tag it lists the "bgcolor=" attribute as "defined elsewhere" yet when the link is followed "bgcolor=" is stipulated as "deprecated" in favour of style sheets. Immediately below the aforementioned link, "bgcolor=" is used in a "deprecated example". OK? Should anyone decypher this please let me know.
this sets the background color. Background above downloads a background file whereas bgcolor sets a background colour. It should be noted that the bgcolor= will be loaded and the background image will be loaded on top of the bgcolor="".
|
| "#rrggbb" |
this is six hexadecimal numbers that stipulates a specific colour from a palette of 32768 colours. The colours are specified in rr= red, gg= green, bb= blue. According to Microsoft, the "#" sign is optional
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
| "colorname" |
in addition to the #rrggbb combination above, specific colours can be specified by name. Supported colours are:
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
bgproperties=
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
This controlls the function of the background and causes it to become a watermark. A watermark is a background that does not scroll with the foreground text. BGPROPERTIES takes only one argument "fixed".
|
class=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
|
credits=
 |
0.9 |
1.2 |
|
|
|
|
This is a WebTV argument. I quote:
"Use the credits attribute to set the URL of a page that will be displayed when the viewer selects the credits button on the Info Panel.
You can use this page to give credit to your company, co-workers, and contributors, or for other information that you'd like viewers to see. Note that the viewer can display the Info Panel by selecting the info button in the Options Panel."
|
dir=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
|
|
| "ltr" |
|
| "rtl" |
|
fontsize=
 |
0.9 |
1.2 |
|
|
|
|
This is a WebTV argument. I quote:
"Use the fontsize attribute to set the size to small, medium, and large. The value for the fontsize attribute overrides the size that the viewer can set in the WebTV Setup pages. The default value for fontsize is medium."
They don't specify what "medium" is.
|
hspace=
 |
0.9 |
1.2 |
|
|
|
|
This is a WebTV argument. I quote:
"Use the hspace attribute to set the horizontal fixed space around the body content. The whole number value for hspace reserves that number of pixels for the right margin and for the left margin. The default value for hspace is 8 pixels.
WebTV Networks does not recommend changing the value for hspace. Among other reasons, the WebTV interface uses the right and left margins for drawing the yellow Highlight rectangle, drawing the edges outside the content area when the selected text runs up against it.
However, you can set hspace=0 on some web pages, such as splash screens, for a good visual effect. If you do change the hspace attribute, note that the new value will change only the content portion of your web page, not a sidebar."
|
id=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
follow the link to more information on this attribute.
|
instructions=
 |
0.9 |
1.2 |
|
|
|
|
"Use the instructions attribute to set the URL of a page that will be displayed when the viewer selects the instructions button on the Info Panel.
You can use this page to explain features to viewers or for other information that you'd like viewers to see. Note that the viewer can display the info Panel by selecting the info button in the Options Panel."
From WebTV's HTML tags pages.
|
lang=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
|
list of language codes
list of country codes
|
leftmargin=
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
this overrides the default margin (default = 0) of the page and allows it to be set n pixels wide. This sets the margin for the entire page and all other tags become relative to this margin.
|
link=
deprecated
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
This sets the colours of hypertext links that have not yet been visited.
The colour chart link below, shows an active link.
|
| "#rrggbb" |
this is six hexadecimal numbers that stipulates a specific colour from a palette of 32768 colours. The colours are specified in rr= red, gg= green, bb= blue. According to Microsoft, the "#" sign is optional
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
| "colorname" |
in addition to the #rrggbb combination above, specific colours can be specified by name. Supported colours are:
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
logo=
 |
0.9 |
1.2 |
|
|
|
|
"Use the logo attribute to set the URL of a logo image to use in place of the thumbnail image for this page. Note that the thumbnail image is used in such places as the Favorites page and the Send Panel.
The size of the logo image is 70 by 52 pixels. Other size images are scaled to fit these dimensions."
From WebTV's HTML tags pages.
|
nohtilebg
 |
0.9 |
1.2 |
|
|
|
|
"Use the nohtilebg attribute to prevent the background image from tiling horizontally. The background image will be displayed at the left margin, repeated from the top of the page to the bottom, but without any horizontal repeat. The color set with the bgcolor attribute colors the background from the right edge of the image to the right margin.
Note that when the nohtilebg attribute is set, the background image does not scroll when the web page content scrolls."
From WebTV's HTML tags pages.
|
novtilebg
 |
0.9 |
1.2 |
|
|
|
|
"Use the novtilebg attribute to prevent the background image from tiling vertically. The background image will be displayed at the top margin, repeated from the left of the page to the right, but without any vertical repeat. The color set with the bgcolor attribute colors the background from the top edge of the image to the bottom margin.
Note that when the novtilebg attribute is set, the background image does not scroll when the web page content scrolls."
From WebTV's HTML tags pages.
|
onBlur=
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
|
onFocus=
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
|
onLoad=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
This started with Netscape and its support of Java and JavaScript. HTML 4.0 now recognizes this attribute but has expanded it to accommodate visual basic and tcl.
The full syntax is:
onLoad="window.status='this is the body tag';return true;"
This will modify the default state of the status line.
This page is using onLoad="window.status='this is the body tag';return true;"
|
onUnLoad=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
This started with Netscape and its support of Java and JavaScript. HTML 4.0 now recognizes this attribute but has expanded it to accommodate visual basic and tcl.
The status line is modified from the default state to that stipulated when a document is removed from the screen usually by clicking another link. In tests it also worked when the "previous document arrow (the back arrow)" on Netscape 4.01 was pressed.
An Example is:
onLoad="window.status='this is the body tag';return true;" onunload="window.status='you are exiting the body tag'; return true;"
This will modify the status line to a default state. It can be used in conjunction with "OnMouseOver" and "OnMouseOut", both listed under the anchor tag.
This page is using "onunLoad=". Return, to the site map using the Compendium Logo at the top of the page and watch the status line at the bottom of the page. It should momemtarily switch to all uppercase "YOU ARE EXITING THE BODY TAG".
|
style=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
|
text=
deprecated
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
this sets the colour of body text. This is especially effective when you use a darker background and wish to make the text more visable.
|
| "#rrggbb" |
this is six hexadecimal numbers that stipulates a specific colour from a palette of 32768 colours. The colours are specified in rr= red, gg= green, bb= blue. According to Microsoft, the "#" sign is optional
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
| "colorname" |
in addition to the #rrggbb combination above, specific colours can be specified by name. Supported colours are:
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
title=
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
|
|
topmargin=
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
0.9 |
1.2 |
|
|
|
|
this is the same as "leftmargin=" above, however it sets the top margin in n pixels. The defaut is "0" which is the very top edge of the viewing area of the browser.
|
vlink=
deprecated
 |
+ |
2.0 |
3.0 |
3.2 |
4.0 |
 |
1.1 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.0 |
3.0 |
4.0 |
|
 |
1.0 |
2.1 |
3.0 |
|
|
 |
0.9 |
1.2 |
|
|
|
|
this sets the colour of hypertext links that have alread been visited. When "link" above has been visited, it takes on the colour of "vlink".
|
| "#rrggbb" |
this is six hexadecimal numbers that stipulates a specific colour from a palette of 32768 colours. The colours are specified in rr= red, gg= green, bb= blue. According to Microsoft, the "#" sign is optional
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
| "colorname" |
in addition to the #rrggbb combination above, specific colours can be specified by name. Supported colours are:
Colours with 140 named Netscape colours and 16 named Internet Explorer colours. This is a complete explanation of colour by: Gernot Metze
|
vspace=
 |
0.9 |
1.2 |
|
|
|
|
"Use the vspace attribute to set the vertical fixed space around the body content. The whole number value for vspace reserves that number of pixels for the top margin and for the bottom margin. The default value for vspace is 6 pixels.
WebTV Networks does not recommend changing the value for vspace. The WebTV interface uses the top margin for drawing the top of the yellow Highlight rectangle when the selected text is in the first line of the web page. Note that the WebTV interface will scroll up when the selected text is in the last line on the screen, allowing it to draw the Highlight rectangle. However, you can set vspace=0 on some web pages, such as splash screens, for a good visual effect. If you do change the vspace attribute, note that the new value will change only the content portion of your web page, not a sidebar."
From WebTV's HTML tags pages.
|
xspeed=
 |
0.9 |
1.2 |
|
|
|
|
"Use the xspeed attribute to set the speed for scrolling the background image horizontally. Note that the web page content remains in place while the background image moves.
The whole number value for xspeed is in pixels per second. The default value of xspeed is 0. xspeed=1 is a slow-motion scroll. xspeed=2 or xspeed=4 is for faster motion."
From WebTV's HTML tags pages.
|
yspeed=
 |
0.9 |
1.2 |
|
|
|
|
"Use the yspeed attribute to set the speed for scrolling the background image vertically. Note that the web page content remains in place while the background image moves.
The whole number value for yspeed is in pixels per second. The default value for yspeed is 0. yspeed=1 is a slow-motion scroll. yspeed=2 or yspeed=4 is for faster motion."
From WebTV's HTML tags pages.
|