![]() |
Shining Star Services LLC
|
|
RETURN TO HTML TUTORIAL HOME HTML Body Tag By Nannette Thacker - 01/30/2001 Below are all examples of valid HTML BODY tags:
You would use a body ONLOAD attribute when you want to have an action occur when the document loads. In the above ONLOAD attribute, you are telling the document to place the cursor in the email field of the form. This allows the user to start typing immediately, without having to tab to the field or use the mouse to put the cursor in the field.
Above is a simple BODY tag.
The above BODY tag includes attributes which allow you to set various colors in the document:
HTML & RGB Color Chart Browser Safe Colors
The above BODY tag is a combination of two you've already seen.
In the above body tag, a background image is set to display with the document.
Here is an example of a web site that uses a background image (this is NOT one of
my web sites):
In the above tag, it sets the color of the background of the document to peach. You may use certain color names instead of RGB colors (red, green, blue). However, color names are only supported in certain browsers.
Below is an example of a web site that changes the background color, using a javascript
to hover over balloon colors (yes, this one is my web site):
The above BODY tag sets the background color to white, as in a previous example. However, the RGB colors are entered in all CAPS. HTML is not case sensitive.
The above BODY tag sets a margin of 50 pixels on the left and on the top. A pixel is about the width of the tip of your thumbnail.
The above BODY sets a background image and uses a new attribute: bgproperties="fixed". This is kind of a neat technique, where when you scroll, the text moves, but the background image doesn't. Try it out here: Here is the original image used:
Notice that you do not have to have an image the size of the page. The system will take the image and duplicate it multiple times to fill the depth and width of the page. To snag the above image and use it on your pages, right click the image, and select "Save Picture As."
|
|
