Set the text-color for different elements:
The color property specifies the color of text.
| Default value: | not specified |
|---|---|
| Inherited: | yes |
| Version: | CSS1 |
| JavaScript syntax: | object.style.color="#FF0000" |
![]()
The color property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "inherit".
Tip: Use a background color and a text color that makes the text easy to read.
| Value | Description | Play it |
|---|---|---|
| color | Specifies the text color. Look at CSS Color Values for a complete list of possible color values. | Play it » |
| inherit | Specifies that the color should be inherited from the parent element |
CSS tutorial: CSS Text
HTML DOM reference: color property
Your message has been sent to W3Schools.