CSS Colors
CSS Colors — Learn all CSS color systems: named colors, hex, RGB, HSL, modern color functions, and alpha transparency. The guide walks through Named Colors and HEX, RGB and HSL, Modern CSS Color Functions, Color Opacity and Alpha. Named Colors: CSS has 148 named colors that you can use directly: .element { color: red; } .element { color: blue; } .element { color: transparent; } .element { color: rebeccapurple; } .element { color: currentColor; } /* Inherits from parent color */ Hexadecimal (HEX): .element { color: #ff0000; } /* Red - 6 digits (RRGGBB) */ .element { color:… RGB (Red, Green, Blue): .element { color: rgb(255, 0, 0); } /* Red */ .element { color: rgba(255, 0, 0, 0.5); } /* Semi-transparent red */ .element { color: rgb(255 0 0 / 50%); } /* Modern syntax */ HSL (Hue, Saturation, Lightness): HSL is more intuitive for creating color schemes: .element { color: hsl(0, 100%, 50%); } /* Red…