Back to Section Main

You can "spice" up your Web pages by adding "color" -- coloring the background of your page -- changing the color of your text -- and adding color in tables on your Web pages.

PAGE COLOR:Using the body tag and attributes, you can set the basic background colors for your Web page as follows:

If you use only the basic body tag -- <BODY> -- then the browser will use the following colors by default, in the absence of any specific attribute being named:

Page background color -- mosaic gray
Text -- black
Links -- blue

However, you can change those colors by using the following tag HTML coding:

<BODY BGCOLOR="colorname or hexcode" TEXT="colorname or hexcode" LINK="colorname or hexcode">


Here's an example using colornames:

<BODY BGCOLOR="white" TEXT="blue" LINK="red">


Here's an example using hexcodes for the colornames above:

<BODY BGCOLOR="#FFFFFF" TEXT="#0000FF" LINK="#000099">


TEXT COLOR: Unless specified, the color of text on a Web page is the color specified in the body tag, or the default color, black.

To change the color of text, you must use the font color tag as follows:

<FONT COLOR="colorname or hexcode">your text</FONT>


Here's an example using "red" text as the colorname:

<FONT COLOR="RED">your text</FONT>


Which would look like this on your page:
your text

Here's the example -- using hexcode for the above colorname:

<FONT COLOR="#FF0000">your text</FONT>


Which would look like this on your page:
your text

TABLE COLORS: On tables, you can have borders with color, using bordercolor, bordercolordark, and bordercolorlight tags as follows:

<TABLE BORDER="10" BORDERCOLOR="colorname or hexcode" BORDERCOLORLIGHT="colorname or hexcode" BORDERCOLORDARK="colorname or hexcode"> </TABLE>

Attributes:
  1. BORDER="n": Specifies the width of the border around the table. If set to 0, there will be no border.
  2. BORDERCOLOR="colorname or hexcode": Specifies the border color of the table.
  3. BORDERCOLORLIGHT="colorname or hexcode": Specifies the lighter color used in creating the 3D borders dependently.
  4. BORDERCOLORDARK="colorname or hexcode": Specifies the darker color used in creating the 3D borders independently.
NOTE: Bordercolor, bordercolordark, and bordercolorlight are supported only by MS Internet Explorer and Prodigy's browser.

You can add color to your "rows" and your "data cells" in your tables by using the bgcolor tag as follows:

BGCOLOR="colorname or hexcode": Specifies the background color of the of the row or cell. When bgcolor tag is used in the row tag -- all data cells carry the row color as follows:

<TABLE BORDER="10" BORDERCOLOR="colorname or hexcode" BORDERCOLORLIGHT="colorname or hexcode" BORDERCOLORDARK="colorname or hexcode">
<TR BGCOLOR="colorname or hexcode">
<TD>your text</TD>
<TD>your text</TD>
</TR>
</TABLE>


Or you can add color to each data cell as follows:

<TABLE BORDER="10" BORDERCOLOR="colorname or hexcode" BORDERCOLORLIGHT="colorname or hexcode" BORDERCOLORDARK="colorname or hexcode">
<TR>
<TD BGCOLOR="colorname or hexcode">your text</TD>
<TD BGCOLOR="colorname or hexcode">your text</TD>
</TR>
</TABLE>


COLOR NAMES/HEXCODES: There are 140 colornames which are supported by Netscape 3.0 and higher, MSIE 3.0 and higher, and Prodigy's browser. These colornames are much easier to use as they are easier to remember than remembering a six digit hexcode for the color. For example, "red" is the colorname and the hexcode for "red" is "#FF0000." Of course, using hexcodes you can have more than 140 colors.




©1999-2001 Prodigy Communications Corporation | Privacy Policy | Trademark Notices
Jump to top of page