How is Background Color Produced in HTML?
There are 5 different aspect of a web page who's color you can control. They are the background, the regular text, the unvisited links, the currently active link and visted links. Of these, the currently active link is least likely to be used. Even with a slow dial-up modem I rare see the links change colors. The color codes supplied in the colorindex are from a collection that I use for some of my projects. They can be used with any of the objects, not just for backgrounds.
The HTML coding is fairly simple. For the background color use this:
<body bgcolor="#FFFFFF">
This produces a page with a white background because the color code #FFFFFF is the code for white.
To change the text color, use the follow:
<body text="#000000">
This produces a page with black text because the color code #000000 is the code for black.
To change the unvisited links color, use the follow:
<body link="#00FF00">
This produces a page with blue links because the color code #00FF00 is the code for blue.
To change the active link color, use the follow:
<body alink="#DB70DB">
This produces a page with purple links while the link is active because the color code #DB70DB is the code for purple.
To change the active link color, use the follow:
<body vlink="#FF0000">
This produces a page with red visted links because the color code #FF0000 is the code for red.
The color code are made up of 3 2-digit codes with each 2 digit code representing the amount of red, blue or green that makes up the color. The digits are not base 10 numbers which make them look strange to most people. They are actually hexidecimal or base 16. So 10 in hexidecimal is 16 in base 10. A color that starts with 00 has no red and a color that ends in 00 has no blue. A color that starts with FF has full red and a color with FF as its middle pair of digits has full green.
There now several utilities for most computers to determine Netscape color codes. There are also some other sites which have cgi programs running which can help in choosing codes. This page was meant to be a cross section of the 16 million codes now available.
Not every browser displays color the same way. For example, Netscape on Macintosh and Windows will sometimes dither color that make up the background. The dithering pattern makes text difficult to read. A solution is create with a graphics program a small square image filled with the color that you want for your background.
Then use Netscape's background comand within the body like so:
<body background="red.gif">
Remember to place a </body> at the end of your html file.