English中文日本語한국어EspañolFrançaisDeutschPortuguêsРусский

CSS Color Codes

CSS supports many color formats, from classic Hex and named colors to modern color spaces for advanced palettes.

Common CSS color formats

Hex, RGB, HSL, and named colors are supported broadly. Modern CSS also supports formats such as OKLCH, which can help produce smoother and more perceptually balanced palettes.

Where CSS colors are used

CSS color values can style text, backgrounds, borders, outlines, shadows, gradients, scrollbars, accent colors, SVG fills, and canvas-driven interfaces.

Choosing readable colors

A color can look attractive and still fail as text. Use contrast checks for foreground and background combinations, especially for buttons, navigation, forms, and cards.

Related color tools

Use these tools to pick, convert, test, and export the color values described in this guide.

More color guides