CSS Colors
COLORS ARE SPECIFIED USING PREDEFINED COLOR
N A M E S , O R R G B, H E X , H S L , R G B A , H S L A VA LU E S .
CSS Color Names
In CSS, a color can be specified by using a predefined
color name:
CSS Background Color
You can set the background color for HTML elements:
CSS Text Color
You can set the color of text:
CSS Border Color
You can set the color of borders:
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":
CSS RGB Colors
An RGB color value represents RED, GREEN, and BLUE light sources.
RGB Value
In CSS, a color can be specified as an RGB value, using this formula:
rgb (red, green, blue)
RED : 0 – 255
GREEN : 0-255
BLUE : 0-255
Color Example