The Html Body Tag

HTML



 WHAT'S NEW 
 HTML FORUM 
 SITE MAP 
 REQUEST HELP 
 TRADE LINKS 
 FREE LINKS PAGE 






WEBMASTERS
Earn Money
Per Click!




SmallDot.com


BraveNet


TrafficSwarm


SourceGuardian


Submit9000


CodeBrain


Color Schemer


FlashBanger


123TurnKey.com


Web Page Templates


Dynamic Drive


Javascript Source


Javascript City


Javascript Kit


JavaPowered


FreewareJava
Home
General
HTML
Java Applets
Javascript
Wizards
Contact


The Html Help Guide


The Body Tag



The <body> tag will set some default attributes for the page. You will add these elements to the body tag that you have.

<body background="image.gif" bgcolor="white" text="black" link="blue" vlink="gray" alink="red">

Here's what these things do.

background="image.gif"
This will add a background image to the page. Be sure to upload the image.

bgcolor="white"
This will make the background color white. It can be any color you want. This will be replaced by the background image if you use one. You should use a background color (that is similar to the basic color of the background image) even if you use a background image.

text="black"
This will make the default text color black. Again you can use any color you prefer. Just make sure the text color will contrast with the background color so you can read the text easily.

link="blue"
This determines the color of any text hyperlinks on the page.

vlink="gray"
The Visited Link color. This is the color that the text link will become after it has been clicked on.

alink="red"
The Active Link color. The color a hyperlink turns to as it is being clicked.

Note: You can use the name of the color such as black, blue, green, red, white and so on in the tag but you will have a much greater variety of colors by using hex codes. The hex code for white is #ffffff for example. There are several web sites that list many colors with their associated hex codes. I suggest that you download one of the "color picker" programs listed on my FREEWARE page.

Other Attributes
There are other elements that are sometimes added to the body tag. Some javascripts require event handlers such as onLoad and onUnload that cause the script to activate as the page is loaded or exited. The bgproperties="fixed" command is Internet Explorer specific and causes the background image to remain static while the page contents scroll.

Keep in mind that a web page can only have one body tag. So if you come across a script, or other page element that requires an addition to the body tag, be sure to add it to the existing one. Too often I have checked out a web page for someone and found that they had added a second body tag for a background image.



Join the Html Help Guide mailing list
Enter your email address.
Subscribe    Unsubscribe