Body Attributes

The <BODY> tag has several useful attributes. You can have a background image, specify the background color, specify the color of the text and links, change the margins, and probably other things that I can't think of at the moment.

BACKGROUND="image.gif"
Choose whatever image you want for the background, and it will be tiled across the screen.

BGCOLOR="#FFFFFF"
Specify the background color using a hexadecimal code.

TEXT="#000000"
Specify the color of all the text on the page using a hexadecimal code.

LINK="#0000FF"
Specify the color of all the links on the page using a hexadecimal code.

ALINK="#FF0000"
Specify the color of active links (being clicked on) using a hexadecimal code.

VLINK="#990099"
Specify the color of visited links (pages the user has already visited) using a hexadecimal code.


Internet Explorer and Netscape Navigator have different attributes for changing the margin. Other browsers won't let you adjust the margin. The Explorer attribute is shown first, the Navigator attribute is shown second.

TOPMARGIN=?   MARGINHEIGHT=?
Specify in pixels the amount of space you want at the very top and bottom of the page. (Don't be deceived. TOPMARGIN controls both the top and bottom margin.)

LEFTMARGIN=?   MARGINWIDTH=?
Specify in pixels the amount of space you want on the sides of the page. (Don't be deceived. LEFTMARGIN controls both the left and right margin.)

 

<BODY BACKGROUND="image.gif" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#990099" ALINK=""#FF0000" TOPMARGIN=0 MARGINHEIGHT=0 LEFTMARGIN=0 MARGINWIDTH=0>

 

Back

Last Modified: Friday, 17-Jul-98 18:28:46 PDT
Page URL: http://geocities.datacellar.net/SiliconValley/Vista/2823/bodyattr.html

1