CSS color Property
Description
The CSS color property is used to define the foreground color of text and text-based elements within an HTML document. It plays a central role in visual design, readability, and user experience, as it directly affects how content is perceived and interpreted by users. While it most commonly controls the color of plain text, it also applies to other text-related elements such as list markers, form input text, and certain inline elements. Because of its wide influence, choosing appropriate text colors is essential for creating accessible and visually balanced layouts.
Beyond aesthetics, the color property contributes significantly to usability and accessibility. Proper contrast between text and its background ensures content remains readable for users with visual impairments or when viewed in different lighting conditions. Designers often pair the color property with background-related properties to maintain clarity and hierarchy across a page. When used thoughtfully, color can guide attention, highlight important information, and improve overall comprehension without overwhelming the user.
The color property also supports inheritance, meaning child elements can automatically take on the text color of their parent unless explicitly overridden. This makes it especially useful for maintaining consistent styling across large sections of a website while reducing repetitive code. When combined with CSS variables or theming techniques, the color property becomes a powerful tool for implementing light and dark modes, brand color systems, and user-customizable themes. Its simplicity and flexibility make it one of the most fundamental yet impactful properties in CSS.
Definition
- Initial value
- Depends on the user agent. For example, your browser sets its own default colors for different elements.
- Applies to
- All elements
- Inherited
- Yes
- Computed value
- For a non-translucent color, an hexadecimal equivalent is used. Otherwise it is the RGBa equivalent
- Animatable
- Yes
- JavaScript syntax
- object.style.color
Interactive Demo
Syntax
color: <color> | inherit
Values
- <color>Is a color value giving the color of the textual elements of the element.
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS color property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
