Answers Search Help
Boston University home page
HTML: Introduction
 
 
    Components
 
 
 
 
 
 
    Syntax
 
 
 
 
 
    Essential Tags
 
 
 
 
 
 
 
 
    HTML Headings
 
 
    Text
 
 
 
 
    Layout
 
 
 
 
 
 
 
    Links & Images
 
 
 
 
    Publishing
 
 
    Also See
 
 

Tag Attributes

Now let's look at a few options you can add to the <body> tag -- attributes for text color and background color. The attribute name for a background color is bgcolor, and the attribute name for text color is simply text. You add these options to the body tag like this:

<body bgcolor="#ffffff" text="#000000">

This sets the background color to white and the text color to black. The number sign followed by the 6-digit (or hexadecimal) alphanumeric code indicates RGB (red-green-blue) color values, which is how monitors display color variations. There are several Web sites where you can test various colors and record their hexadecimal values. Noted Web author Lynda Weinman has a browser-safe color page that lists both hexadecimal and RGB color values.

There are also several plain-text color names that can be used.

<body bgcolor="white" text="black">

This code produces the same result as the tag used in the previous paragraph. The plain-text color names that can be used are: black, white, aqua, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, and yellow.

 

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   January 9, 2007