CSS color Property Reference

The CSS color property sets an element’s foreground color.

CSS color Property Reference

The CSS color property sets an element’s foreground color.

Updated 2026-08-07

Syntax and inheritance

The foreground color is used for text and text decorations and becomes the currentColor value inherited by other properties.

CSS .notice { color: oklch(45% 0.16 250); }

Common color values

SyntaxExampleUse
Named colorrebeccapurpleReadable fixed colors
Hexadecimal#663399ccCompact sRGB with optional alpha
rgb()rgb(102 51 153 / 80%)sRGB channels
hsl()hsl(270 50% 40%)Hue, saturation, and lightness
oklch()oklch(45% 0.16 300)Perceptual lightness, chroma, and hue
currentColorcurrentColorReuse the computed foreground color

Accessibility

Description

The CSS color property sets an element’s foreground color.

References

  1. CSS Color Module Level 4
  2. MDN: color

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies