HTML/XHTML:Colours and CSS
|Table of contents|
A brief introduction to how colours are represented
Colours are described to a web browser in a Red-Green-Blue (RGB) combination. Each colour setting is normally numbered in a system called hexadecimal (though there are other ways) with the values between 00 (off) and FF (full on). There are 256 possible numbers.
- The diagram illustrates the 16 standard colours with their names, RGB decimal values and the hexadecimal RGB value. *These colours can be used with the expectation that they will appear (be rendered) the same on all browsers and platforms.
- The colour settings represent zero (00) half (80 or decimal 128) and full (FF or decimal 255) values, except for silver.
- These colours are derived from the original IBM PC (1980) and its colour graphics array (CGA) video card and the original 16 colour windows colour set.
- Also each colour is displayed on a white and black background to show contrast.
- Note gray and grey are both ok.
If we want to change the colour (color?) of text between two tags we can use the color style for example:
Which would display as
Changing the background colour of a web page
You can change the background colour of a we page by using the background-color style and attaching it as a container value in the body tag. The following example makes the web page light blue (aqua):