Lesson 2
Adding Color
There are two ways to specify colors within your webpage.
1. Hexadecimal codes
Colors are defined by hexadecimal codes; the color being determined by its
proportion of red, green, and blue.
Some examples of hexadecimal numbers are:
#000080
#FF0000
#00B800
#FF00FF |
To choose the hexadecimal color you wish to use, check
this out.

2. Color names
There are 140 defined color names available. Be aware that they are only
recognized by Netscape 3.0 and Internet Explorer 3.0 or higher.
Some examples of color names are:

Adding Colors to Your Webpage
Body Colors:
The body colors are all set within the body tag, eg: <body
bgcolor="#rrggbb" text="#rrggbb" link="#rrggbb"
vlink="#rrggbb" alink="#rrggbb">
1. Background color:
- <body bgcolor="#rrggbb">
This sets the background color.
2. Text color:
- text="#rrggbb"
This sets the text color. If you do not specify a text color, it will
automatically default to black.
3. Link color:
- link="#rrggbb"
This sets the color for your links.
4. Visited link color:
- vlink="#rrggbb"
This sets the color for visited links.
5. Activated link color:
- alink="#rrggbb"
- This sets the color for activated links.
The sample below would set the background color of the page as yellow, text as
red, etc <body bgcolor="#ffffd8" text="#ff0000"
link="#0000ff" vlink="#ff0000"
alink="#00a000">

Font colors:
- You can change the color of text within your page by using the <font
color> tag, eg,
<font color="#rrggbb">
The code would look like this:
This text is a <font color="#ff00ff">different
color</font> than the rest.
This is what it would look like in the browser:
This text is a different color than the rest.

Table Colors
- You can also vary your table background colors. To change the background
for the entire table.
-
<table bgcolor="#00b800">
| Colors |
Hex Number |
| Red |
#ff0000 |
| Navy Blue |
#00B800 |
To change to background color of just one cell:
<td bgcolor="#rrggbb">.
| Colors |
Hex Number |
| Red |
#ff0000 |
| Navy Blue |
#00B800 |
|