<color>
Widely availableSince 201595% of users
Sets the foreground color of an element's text content. It accepts various formats like HEX, RGB, HSL and named colors.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassic, with newer partsIt has worked everywhere since July 2015, and it keeps getting newer values.
Newer parts of <color>
alpha()Baseline Sept 2026contrast-color()Baseline Apr 2026light-dark()Baseline May 2024, Widely Nov 2026color() (Profiled color values)Baseline May 2023, Widely Nov 2025color-mix()Baseline May 2023, Widely Nov 2025lab() (Lab color model)Baseline May 2023, Widely Nov 2025lch() (LCH color model)Baseline May 2023, Widely Nov 2025oklab() (Oklab color model)Baseline May 2023, Widely Nov 2025
See how modern your own CSS is.Check your CSS →
Quick example
.text-primary {
color: #2563eb;
/* using a hex color */
}<color> browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.Safe to use without fallbacks.
Usage95%of people can use this5% use a browser without it.
Browsers
1+
1+
1+
12+Mobile
18+Android
4+Android
1+iOS