CSS Color Values

List of color values that can be used with CSS.

CSS provides multiple ways of specifying a color value when applying color to web pages and other documents. For example, can use a color name, an RGB value, an HSL value, and more.

Here's a list of color values that can be used with any of the CSS properties that accept a color value.

Examples

Here are some quick examples of the various color values.

HSL

The hsl() function allows you to create colors by specifying the hue, saturation, and lightness levels.

HSLA

Same as the hsla() function, but allows you to create a transparent color by using a fourth value. The fourth value represents the alpha channel of the color.

RGB

The rgb() function lets you create a color by adding varying amounts of red, green, and blue together.

RGBA

The rgba() function is the same as the RGB method, but allows you to create a transparent color by setting a fourth value. The fourth value represents the alpha channel.

Hex 6-Digit

Allows you to specify RGB colors using six-digit hexadecimal notation.

Hex 3-Digit

The three-digit notation is shorthand for the six-digit method.

Hex 8-Digit

The eight-digit hex notation is like the six-digit method, but it allows you to specify a transparent color by using a fourth color component, which specifies an alpha channel for the color.

Hex 4-Digit

The four-digit notation is shorthand for the eight-digit method.