Learn CSS: Colors
Color web pages with confidence. Set text and background colors, write colors as names, hex codes, RGB and HSL, add transparency, use currentcolor and modern functions like oklch() and color-mix(), check contrast for accessibility, and organize a palette with custom properties.
- Beginner level
- 3 modules
- 17 lessons
- 113 tasks and questions
Syllabus
01Color BasicsSet text and background colors, and write colors as names, hexadecimal codes, RGB values and HSL values, then convert one color between all four.6 lessons
02Transparency and currentcolorMake colors see-through with an alpha channel, predict what shows through stacked layers, let borders and icons follow the text color with currentcolor, and fix the usual broken color declarations.5 lessons
03Modern Color and ContrastUse oklch() and color-mix() with safe fallbacks for older browsers, measure text contrast against the WCAG ratios, and keep a whole palette in custom properties.6 lessons