The body tag

BY WIL GERKEN

The body tag has a number of arguments all relating to color and backgrounds. You may only have one body tag on a page. Here is a list of the most common tags:

  • bgcolor - color of background (first layer)
  • background - image to display as background (optional second layer)
  • text - color of text
  • link - color of links you haven't been to
  • alink - color of the "active link" (transitional color)
  • vlink - color of links you have been to

The first tag I wanted to go over was the background tag which states what image to use as a background.

<body background="mybackground.gif">

This would cause "mybackground.gif" to be displayed as the background. For more information and examples on backgrounds, please read the design loop on backgrounds.


Colors

All of the additional tags are for solid colors. Colors should only be chosen from the 216 web palette. All color values are in hexadecimal, not decimal.

To convert a color to hexadecimal, you can use Mediarama's color converter. This converter allows you to view the page using the 216 color palette (Show Netscape's closest non-dithering colors) or the full palette. Again, be sure to only choose colors from the 216 color palette.

Tools:

After you have your color values in hexadecimal, you type them in as follows:

<body bgcolor="#ffffff" link="#ff0000" vlink="#003399" alink="#000000" text="#000000">

This example is the current page you are viewing.

  • bgcolor="#ffffff" - background color = white
  • link="#ff0000" - link color = red
  • vlink="#003399" - visited link color = blue
  • alink="#000000" - active link color = black
  • text="#000000" - text = black


Page Back Page Forward

Home . About . Syllabus . Design Guide . Message Board

©1997-98 Wil Gerken