Adding Color

Color by Name (Literal Value)

The following are the basic 16 literal color values:

black blue cyan gray green lime magenta maroon
navy olive purple red silver teal white yellow

black blue cyan gray green lime magenta maroon
navy olive purple red silver teal white yellow

 

Changing the Page Colors

Default page colors can be changed globally by the inclusion of attributes within the opening <body> tag:

<body bgcolor="color" text="color" link="color" vlink="color" alink="color">

Attributes:
bgcolor= sets the background color for the page.
Default color is silver.
text= sets the text color for the page.
Default color is black.
link= sets the color of text links.
Default color is blue.
vlink= sets the color of text links that have been visited.
Default color is purple.
alink= sets the color of text links as they are clicked.
Default color is red.

See An Example
Test Color Combinations
Note: This will open a new browser window.

 

Changing the <font> Colors

<font color="color"> </font>

Example Code:
<font color="green">The </font><font color="red">quick </font><font color="maroon">brown </font><font color="silver">fox, </font><font color="blue">jumps </font><font color="lime">over </font><font color="magenta">the </font><font color="cyan">lazy </font><font color="olive">dog.</font>

The Result:

The quick brown fox, jumps over the lazy dog.

 

Using Hex Colors

black
#000000
blue
#0000FF
cyan
#00FFFF
gray
#808080
green
#008000
lime
#00FF00
magenta
#FF00FF
maroon
#800000
navy
#000080
olive
#808000
purple
#800080
red
#FF0000
silver
#C0C0C0
teal
#008080
white
#FFFFFF
yellow
#FFFF00

Click here for more colors
Note: This will open a new browser window.

 

<Lists ^Top of Page Adding Graphics>

XHTML Basics Workshop
© 1996-2005