Colors

CSS expresses colors in several forms: names (red), hexadecimal (#1a73e8), rgb(), hsl() (hue, saturation, lightness), and newer color spaces such as oklch(). They apply to text (color), background (background-color), or borders. Contrast must remain sufficient for readability.

Example

color: hsl(210 80% 40%);
background-color: #f5f5f5;

Related concepts

The whole glossary