CSS HEX Colors

HEX Value

In CSS, you can specify colors using the following format of hexadecimal values:

#rrggbb

Where rr (red), gg (green), and bb (blue) are hexadecimal values between 00 and ff (the same as decimal 0-255).

For example, #ff0000 is displayed as red because red is set to the maximum value (ff), and the others are set to the minimum value (00).

Please experiment by mixing the following hexadecimal values:

 

RED

ff

GREEN

0

BLUE

0

Examples

#ff0000
#0000ff
#3cb371
#ee82ee
#ffa500
#6a5acd

Try It Yourself

Grey shadows are usually defined with equal values for all 3 light sources:

Examples

#000000
#3c3c3c
#787878
#b4b4b4
#f0f0f0
#ffffff

Try It Yourself