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:
- Firefox 1, 2
- Internet Explorer 3, 4, 5, 6, 7
- Mozilla 1
- Netscape 4, 6, 7, 8
- Opera 3, 4, 5, 6, 7, 8, 9
- Safari 1, 2
color Examples:
Standard color property
<p style="color : #f00;">This paragraph is red.</p>
Use the text attribute of the body element [blockquote shade=yes]body { color: attr(text,color }[/blockquote] [link url=/od/examples/l/bl_color.htm]See other CSS color examples[/link] _z_webdesign_z_);
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.

