In an HTML document colors are specified with a six digit hexadecimal number.
The hexadecimal system of counting uses the base 16 as compared to 10 used in the decimal system. The following compares the two sytems
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 etc
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 etc
The decimal number 10 is represented by the letter A in hexadecimal, dec 20 =hex 14 and dec 32=hex 20 etc.
In the 6 digit hexadecimal number the first two digits (XX0000) represent the amount of RED, the middle two digits (00XX00) the amount of GREEN and the last two digits (0000XX) the amount of BLUE. Where XX is replaced by a hexadecimal number between 00 and FF. The maximum amount of each color is given by the number FF (255 in decimal) and the minimum is 00 (0 in decimal). Thus full RED is given by FF0000, full GREEN by 00FF00, and full BLUE by 0000FF.
Tints, shades and combination colors can be produced by varying the amount of RED, GREEN and BLUE.The following gives some examples.
White = FFFFFF, BLACK = 000000, YELLOW = FFFF00, MAGENTA = FF00FF, CYAN = 00FFFF.
Many computer screens (and/or video cards) can only display 256 or worst still 16 colors, whereas the six digit hexadecimal color code can specify 16.7 million. To allow for this a 256 color screen/ video setting will attempt to produce addition colors by mixing combinations of the 256 it can produce. This process is known as dithering. When used to produce a background color dithering can produce an unpleasant granular effect that is often difficult to read text against.
By now you may have come to the conclusion that specifying anything other than white (FFFFFF) for a background color is fraught with problems, I would agree with you. Default is quite a nice color too ;).