Logo HTML Topics: Colours

Course Material Index  Section Index  Previous Page  Next Page 

Colours

Although colour is now more common in scientific textbooks, its use is nowhere near as widespread as in web pages. Colour is a useful attribute in the creation of web pages, though care should be taken in its use. The human is very sensitive red: red is therefore used to grab the attention of the eye, but over use of it will give you eye strain. By contrast the eye is less sensitive to blue, and so it is often used as a background colour when making slides or overhead transparencies.

Background colours were originally Netscape and Internet Explorer extensions to HTML 3.2. In this course the background colour is simply set to white. This is achieved using the BGCOLOR attribute of the <BODY>  tag used near the top of the document, e.g.

<BODY BGCOLOR=WHITE>

Text can be coloured using the COLOR attribute of the <FONT>  tag discussed earlier, e.g.

<FONT COLOR=RED>This text is red</FONT>

The value of the attribute can be set either by name, e.g. COLOR=MAGENTA as in this text is magenta or by a number written in the form #rrggbb where rr, gg, and bb represent the RGB (Red Green Blue) colour triplet coded in hexadecimal, where 00 equals 0 equals 0% and FF equals 127 equals 100%. Thus:

  #FF0000 =RED
  #AA00AA =PURPLE
  #33FF33 =LIGHT GREEN
  #000000 =BLACK
  and #FFFFFF =WHITE!?

If you plan to use sophisticated colour schemes, be sure to visit the external webpages on colour given in the Web Authoring Links.


Course Material Index  Section Index  Previous Page  Next Page 
© Copyright 1995-2006.  Birkbeck College, University of London. Author(s): Jeremy Karl Cockcroft
Huub Driessen