CSS color values
| Value | Type | Range |
|---|---|---|
| red | color name | - |
| #ff0000 | color hex (six-digit) | 00 - ff (#000000 - #ffffff) |
| #f00 | color hex (three-digit) | 0 - f (#000 - #fff) |
| rgb(255,0,0) | color rgb (number) | 0 - 255 (0,0,0 - 255,255,255) |
| rgb(100%,0%,0%) | color rgb (percentage) | 0% - 100% (0%,0%,0% - 100%,100%,100%) |
.example1 { color: red; }
.example2 { color: #ff0000; }
.example3 { color: #f00; }
.example4 { color: rgb(255,0,0); }
.example5 { color: rgb(100%,0%,0%); }
The color is specified as a color name.
.example1 { color: red; }
.example2 { color: green; }
.example3 { color: blue; }
| red | lime | blue | white | black |
The color is specified as a six-digit hex code.
.example1 { color: #ff0000; } /* Red */
.example2 { color: #00ff00; } /* Green */
.example3 { color: #0000ff; } /* Blue */
This hex code is a character string of six digits preceded by a hash character (#).
#ffffff
The first and second digits : Sets the level of the Red color.
The third and fourth digits : Sets the level of the Green color.
The fifth and sixth digits : Sets the level of the Blue color.
The range of each level : 00 (lowest level) - ff (highest level)
[The character used : 0 1 2 3 4 5 6 7 8 9 a b c d e f ]
| #ff0000 | #00ff00 | #0000ff | #ffffff | #000000 |
The color is specified as a three-digit hex code. (CSS only)
.example1 { color: #f00; } /* Red */
.example2 { color: #0f0; } /* Green */
.example3 { color: #00f; } /* Blue */
This hex code is a character string of three digits preceded by a hash character (#).
#fff
The first digit : Sets the level of the Red color.
The second digit : Sets the level of the Green color.
The third digit : Sets the level of the Blue color.
The range of each level : 0 (lowest level) - f (highest level)
[The character used : 0 1 2 3 4 5 6 7 8 9 a b c d e f ]
| #f00 | #0f0 | #00f | #fff | #000 |
The color is specified as a rgb triplet. (CSS only)
.example1 { color: rgb(255,0,0); } /* Red */
.example2 { color: rgb(0,255,0); } /* Green */
.example3 { color: rgb(0,0,255); } /* Blue */
This rgb value is specified by a number.
rgb(255,255,255)
The first number : Sets the level of the Red color.
The second number : Sets the level of the Green color.
The third number : Sets the level of the Blue color.
The range of each level : 0 (lowest level) - 255 (highest level)
| 255,0,0 | 0,255,0 | 0,0,255 | 255,255,255 | 0,0,0 |
The color is specified as a rgb triplet. (CSS only)
.example1 { color: rgb(100%,0%,0%); } /* Red */
.example2 { color: rgb(0%,100%,0%); } /* Green */
.example3 { color: rgb(0%,0%,100%); } /* Blue */
This rgb value is specified by a percentage.
rgb(100%,100%,100%)
The first percentage : Sets the level of the Red color.
The second percentage : Sets the level of the Green color.
The third percentage : Sets the level of the Blue color.
The range of each level : 0% (lowest level) - 100% (highest level)
| 100%,0%,0% | 0%,100%,0% | 0%,0%,100% | 100%,100%,100% | 0%,0%,0% |