CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit for current CERN information.

CERN home pageCERN home pageThe Consult pageThe Consult pageThis pageThe Consult pageThis pageThis pageHelp, Info about this page
Previous:X11 Desktop Environments (KDE and GNOME)(See printing version)
Next:Questions and Answers from the Computing Helpdesk

A Guide to Web Colouring

Maria Dimou , IT/User Support

This article explains how to introduce colour on Web pages. People who use proper authoring tools like Dreamweaver or Frontpage need to read only the instructions for using the colouring palette offered with these products. For users who edit a limited amount of single Web pages, the way to introduce colour with the Netscape Composer is also included. The rest of the article is mostly for "real" HTML editors. It is based on Web documents listed in the references list at the end.

N.B. The Web version of this document is made in colour with the following specification:

<body bgcolor="#692CCF" text="#FFFF66" link="#FF9900" alink="#FF00FF" vlink="

Use of colours with Dreamweaver

From the menu "Modify" select "Page Properties". You will get a full palette of colours for the background, text and links to choose from. By clicking on the actual palette image you can create your own nuances.

Use of colours with Frontpage

From the menu "File" select "Page Properties" and then "Background". You will get a small list of colours and the possibility to create yours (by selecting "Custom").

Use of colours with Netscape Composer

If one has only a few independent pages to maintain the Netscape Composer is just fine, i.e. disguises the HTML syntax without the overhead of learning to use a complete tool. From the browser top menu click on
"File" --> "Edit"
and you are in the Composer page. Colours can be selected by clicking on
"Format" --> "Page Color and Properties"
at the page top.

Related HTML tags [1]

The browsers that follow the HTML 3.2 specification allow a few attributes to the BODY element that influence the appearance of the document's background, the text and also the links.

Here is an overview of the attributes:

If Autoload Images (Netscape) is OFF the background image (if any) won't be shown. Similarly the [A|V]LINK values will be ignored, in case the default background colour with the chosen link colours make the text unreadable.

Syntax example [2]

<TITLE>Color Control Example</TITLE> 
<BODY BGCOLOR="#000000" TEXT="#F0F0F0" 
      LINK="#FFFF00" VLINK="#22AA22" ALINK="#0077FF"> 
This is an example document.  Text is light-gray on black, and 
<a href="nowhere.html">anchors</a> are yellow at first, 
flashing blue-green when activated, and pale green if already visited. 

As the BODY tag is the place where colour enhancements can be added, no further change is possible until the end of the document. The way to achieve multiple background colours in the same page is to use Style Sheets [9] and [10].

What are these attributes?

The BACKGROUND attribute requires an image, for example: BACKGROUND="my_image.gif"

All the others require a colour code given in hexadecimal format, for example: BGCOLOR="#FFFFFF"

Netscape and Internet Explorer understand colour descriptions, for example: BGCOLOR="Green" but there is no list [3] of colour names that works fine in both browsers.

The easiest way to find the HEX numbers that represent a colour (if one types HTML and doesn't use an editing tool like the ones mentioned above), is to use some of the matrices on the Web like in [4], [5] , [6] ,[7] or [8].

This value format in hexadecimal corresponds to #RRGGBB, where RR=Red, GG=Green and BB=Blue. All possible colour combinations give, in the decimal system, 256^3, i.e. about 17 million colours.

However, to achieve sharp colours that show reasonably on all platforms and browsers it is wiser to stick to the 256 of Netscape which do not dither [11].

Browser handling

The browsers used at CERN largely support colour handling since the tags appeared as early as HTML 3.0. Netscape became compliant already in version 1.1 and Microsoft Internet Explorer as of version 2.0. Readers using other browsers can find a complete list as part of [1] .

It is possible to define different background colours in TABLE cells. The "HTML source" of the CERN Home page is an example of how to do that. However, Netscape versions prior to 3 can't distinguish any but the background colour (try to view the CERN Users' Welcome page with Netscape version 2.02). Thus, when using special colours for table cells and links one should make sure readers with old browsers can always read their text.


[1] The background FAQ (Mark Koenen,

[2] Document specific background and foreground control (Netscape assistance).

[3]Netscape's colour table with colour names.

[4]HYPE's colour specified for Netscape >= v.3.

[5]J. Tompkins' HTML colour codes.

[6]The Netscape Color Palette Map (Victor S. Engel)

[7]Dougie's Color Picker (Douglas R. Jacobson).

[8]Background colours (

[9]Web consortium site on Styles

[10]Online Course on CSS

[11]The 256 colors of Netscape

[12] Poynton's color FAQ

For matters related to this article please contact the author.

Last Updated on Thu Dec 16 12:02:23 GMT+03:30 1999.
Copyright © CERN 1999 -- European Laboratory for Particle Physics