CSS Colors

CSS colors can be specified in a variety of ways. Some of the most common ways to specify colors in CSS includes:

Color names: There are 147 named colors in CSS that can be used.

Examples include:

"red", "green", "blue", "yellow", "orange", "pink", "purple", and many others.

This is an example of how to use a color name in CSS:

selector { color: red; background-colour: yellow; }

Hexadecimal notation: Colors can also be specified using a 6-digit hexadecimal value, which represents the amount of red, green, and blue in the color. The first two digits represent the red value, the next two represent the green value, and the last two represent the blue value.

For example,

#ff0000 is pure red,

#00ff00 is pure green,

#0000ff is pure blue.

Last updated