HTML CSS JavaScript SEO Python Posts Privacy About Contact

CSS Colors

CSS colors can be specified using names, HEX codes, RGB, and RGBA values.

CSS lets you apply color to text, backgrounds, and borders using different formats: color names, HEX codes, RGB, and RGBA (with transparency).

Try It — All Color Types in One Page

Preview

Color Format Reference

FormatSyntaxExample
Color Namecolor: red140+ built-in names
HEXcolor: #FF5733#RRGGBB
RGBcolor: rgb(255, 87, 51)0–255 per channel
RGBAcolor: rgba(255, 87, 51, 0.5)RGB + alpha (0–1)

Tip: HEX codes are the most popular format in professional projects. Tools like the Chrome DevTools color picker let you visually pick any HEX value.