CSS Colors
CSS colors are used to represent different colors. It is used to set either the foreground color of the element or the background color of the element. It is also used to specify the border and outline color of the element.
How To Assign Color
Colors are assigned to the element by predefined color names, or RGB, HEX, HSL, RGBA, and HSLA values.
Assigning Color Using Predefined Color Names
There are following predefined colors name that is used to specify the different color name. These are aqua, black, blue, green, lime, fuchsia, gray, maroon, navy, silver, teal, olive, purple, red, white, yellow, orange, and indigo.
h1 {
color: red;
}
p {
color: purple;
}
Note: CSS color is applied to the HTML element by following methods such as predefined color names, or RGB, HEX, HSL, RGBA, HSLA values.