Css can process 16,777,216 colors and use names, rgb values, or hexadecimal code.
Red
Equivalent
Rgb (255, 0, 0)
Rgb (100%, 0%, 0%)
# Ff0000
# F00
There are 17 pre-determined colors, which are:
Aqua, black, blue, fuchsia, gray, green, lime, maroon, navy,
Olive, orange, purple, red, silver, teal, white, and yellow.
Transparent is also a correct value.
The three values of rgb are from 0 to 255, which is the lowest level and is the highest level. These values can also be percentages.
We usually use the hexadecimal notation 0-9, but hexadecimal uses the hexadecimal notation 0 to f.
In hexadecimal notation, three or six digits are preceded by # characters, and the three are six compression formats. For example, # f00 is the compression of ff0000 and # c96 is # cc9966. Three digits are easy to understand, such as rgb. The first is red, the second is green, and the third is blue. But the six digits give more color control.
Color and background-color
The color can use color and background-color, which are "color" not "color" in American English ".
Blue background, yellow text:
H1 {
Color: yellow;
Background-color: blue;
}
These colors may be rough and you can use another color:
Body {
Font-size: 0.8em;
Color: navy;
}
H1 {
Color: # ffc;
Background-color: #009;
}
You can see that h1 has become yellow and blue. color and background-color can be used in most html elements, including the body.