Introduction To HTML
Colours In HTML

In the page on tables, the bgcolor attribute was used to display a table cell with a specific background colour.

Named Colours

The following 16 colour names are valid for use in HTML,

aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.

Hex Colours

HTML colours are described in a hexadecimal notation defining the amount of red, green and blue in the colour. HTML colours are written as 3 pairs of hexadecimal numbers starting with a # sign.

Hex numbers go from 00 to FF and this notation allows you to describe 255 x 255 x 255 (16 million colours).

  • Pure red colour is defined by the hex value #FF0000
  • Pure green colour is defined by the hex value #00FF00
  • Pure blue colour is defined by the hex value #0000FF

Hex Colour Selector

You can use the form below to mix up your own colour using the hexadecimal notation. Type in amounts of red, green and blue using numbers from 0 to 255. Press the button to see a sample and then copy the hexadecimal code that is produced.

      Sample