color Description:
The color property defines the foreground color (usually the text) of the element.
color in CSS Versions:
color Syntax:
color: <color> | attr(<identifier>,color) |inherit
- <color> - a color code
- attr(<identifier>,color) - use the color value assigned to the attribute identified in this line (CSS 3)
color Initial Value:
Depends upon the user-agent.
color Applies To:
All elements.
color Inheritance:
This property is inherited.
color Browser Support:
color Examples:
Standard color property
<p style="color : #f00;">This paragraph is red.</p>
Use the text attribute of the body element
body { color: attr(text,color); }See other CSS color examples
color Special Notes:
- This value is inherited by any borders of the element (the border-color property overrides this).
- Colors can be defined as hexadecimal (#ff0000), RGB (rgb(255,0,0)), or color names (red).
- Transparent is a valid keyword and lets any color below the current foreground show through. This keyword was added in CSS 3 to the color property.
- CSS 3 adds hue-saturation-lightness as a color value as well. For example: hsl(0,100%,50%) is "red" or #ff0000.
More color Information:

