CSS Colors

Colors are specified using predefined color names, or RGB, HEX, HSL, RGBA, HSLA values.

CSS Color Names

In CSS, a color can be specified by using a predefined color name:

Tomato

Orange

DodgerBlue

MediumSeaGreen

Gray

LightGray

SlateBlue

Violet


CSS Background Color

You can set the background color for HTML elements:

Example

Output :

CSS Text Color

You can set the color of text:

Example

Output :

CSS Border Color

You can set the color of borders:

Example

Output :

CSS Color Values

In CSS, colors can also be specified using RGB values, HEX values, HSL values, RGBA values, and HSLA values:

Same as color name "Tomato":

Example

Output :