If we use the English names for colors, we are limited to using only these 17 predefined colors. However, with hexadecimal color codes, we can choose from over 16 million colors!
The decimal number system is based on the number 10. The hexadecimal numbers is based on the number 16.
For the numbers 0 to 9, the decimal and hexadecimal numbers are the same.
However, decimal numbers 11 to 15 correspond to hexadecimal numbers A to F:
Decimal 10 is hexadecimal A.
Decimal 11 is hexadecimal B.
Decimal 12 is hexadecimal C.
Decimal 13 is hexadecimal D.
Decimal 14 is hexadecimal E.
Decimal 15 is hexadecimal F.
And Decimal 16 is hexadecimal 10!
When making a RGB hexadecimal color code,
the numbers are preceeded by a pound sign (#).
The 6-digit hexadecimal number is divided into 3 parts:
The first two numbers are for red.
The second two numbers are for green.
The last two numbers are for blue.
Note that hexadecimal 00 has no color, and hexadecimal FF is 100% of that color.
For example:
#FF0000 is red, which has no green or blue.
#00FF00 is green, which has no blue or red.
#0000FF is blue, which has no red or green.
See rgb.css for some more examples of hexadecimal colors.
Click to validate the HTML code
Click to validate the CSS code