Colour Units

A colour is a either a colour name or a numerical RGB specification. The Style Sheet specification (and style sheets as implemented by Microsoft in the Internet Explorer) supports all of the Netscape colour names.

The following all specify a red colour
EM { color: #F00 }#RGB
EM { color: #FF0000 }#RRGGBB
EM { color: rgb(255,0,0)integer range 0 - 255
EM { color: rgb(100%, 0%, 0%)float range 0.0% - 100.0%

Note that a three-digit RGB notation (#RGB) is converted into six-digit form (#RRGGBB) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00.

Values outside the numerical ranges will be rounded off. The three rules below are therefore equivalent:
EM { color: rgb(255,0,0)integer range 0 - 255
EM { color: rgb(300,0,0)rounded off to 255
EM { color: rgb(110%, 0%, 0%)rounded off to 100%