UvA FNWI UvA


 
  112 visitors in
May 2012
 
  last update
26 - 09 - 2004
 
 

 

Using Color on Your Web Pages

Introduction

HTML allows you to change the background color of your page, as well as the foreground colors of the text and visited links.

A color is composed by specifying the red, green and blue components of the color in hexadecimal notation, with a # in front. For example, to specify white, the red, green and blue components are 255, 255, 255, so you would use "#FFFFFF". You can also use the following color names, although they are not as widely supported as the codes:

Black #000000  
Silver #C0C0C0  
Gray #808080  
White #FFFFFF  
Green #008000  
Olive #808000  
Lime #00FF00  
Maroon #800000  
Red #FF0000  
Purple #800080  
Fuchsia #FF00FF  
Aqua #00FFFF  
Blue #0000FF  
Navy #000080  
Teal #008080  

For example, to give your page a white background color, use the following <BODY> tag:

<BODY BGCOLOR="white">

The following attributes can be set in the BODY element:

attribute description
BGCOLOR="#RRGGBB" Background color
TEXT="#RRGGBB" Foreground text color
LINK="#RRGGBB" Link color
VLINK="#RRGGBB" Visited Link color
ALINK="#RRGGBB" Active Link color

Notes

  • Make sure that the combination of a background color and a foreground text color remains readable.
  • Do not set unvisited and visited links to the same color, it will confuse your readers.

RGB Color Chart

Sometimes, a browser will have to use dithering to approach the right color. If you use one of the colors in the following chart, Netscape won't have to dither your colors.

RBG Color Chart

This Color Picker helps you to find the right colors.