CSS <named-color> Data Type
The <named-color> data type is a color keyword, such as red, teal or rebeccapurple. CSS defines 148 named colors, plus transparent.
Description
The <named-color> CSS data type represents a color given by a predefined keyword, such as red, teal, goldenrod or rebeccapurple. CSS defines 148 named colors (including duplicate spellings such as gray and grey), each mapped to an exact sRGB value. A named color can be used anywhere a <color> is accepted.
Many names come from the original 16 HTML colors, such as black, white, navy and olive. Most of the others come from the X11 color list used in early Unix systems, which is why some names are surprising: darkgray is actually lighter than gray, and green (#008000) is much darker than lime (#00ff00). The most recent addition, rebeccapurple (#663399), was added in memory of Rebecca Meyer.
Named colors are case-insensitive, so Red and RED work too. They are always fully opaque, apart from transparent, which is a separate keyword. Named colors are convenient for quick prototypes and examples, but for brand colors and design systems a precise format such as <hex-color> or oklch() is usually clearer.
Examples:
h1 { color: rebeccapurple; }
.ok { background-color: palegreen; }
.danger { border-color: crimson; }
.muted { color: slategray; }
Interactive Demo
Syntax
<named-color> = aliceblue | antiquewhite | aqua | ... | yellow | yellowgreen
Values
- <named-color>One of the 148 predefined color keywords, such as black, white, red, green, blue, orange, purple, rebeccapurple, cornflowerblue or tomato. Keywords are case-insensitive. See CSS Color Names for the full list with their hex values.
Example
Browser Support
The following information will show you the current browser support for the CSS named-color data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





