CSS Colors
CSS colors can be specified using names, HEX codes, RGB, and RGBA values.
Table of Contents
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
| Format | Syntax | Example |
|---|---|---|
| Color Name | color: red | 140+ built-in names |
| HEX | color: #FF5733 | #RRGGBB |
| RGB | color: rgb(255, 87, 51) | 0–255 per channel |
| RGBA | color: 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.