Named colors
Named colors provide human-readable keyword values such as red, navy, and rebeccapurple. They are convenient for quick styling and examples.
Overview
Named colors provide human-readable keyword values such as red, navy, and rebeccapurple. They are convenient for quick styling and examples.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | 1 | 18 | 1 | |
| CSS type | ||||||
named-color.rebeccapurple | 38 | 12 | 33 | 9 | 38 | 8 |
named-color.transparent | 1 | 12 | 3 | 3.1 | 18 | 2 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
.error {
color: red;
border-color: crimson;
}
.success {
color: forestgreen;
} Live demo
Use cases
Quick prototypes
Use named colors when readability matters more than strict palette control in early exploration or examples.
Educational examples
Named colors are approachable in documentation and learning material where literal color names help explain intent.
Cautions
- Named colors can be too coarse for polished product palettes and may encourage inconsistent styling across a large app.
- Color names still do not communicate semantics such as success, warning, or emphasis by themselves.
Accessibility
- A simple keyword value still needs the same contrast checks and meaning redundancy as any other color choice.
Related links
Powered by web-features