color
Specifies the text color (font color).
Sample Code
div.test { color: #0000ff;}
div.test1 { color: red;}
Available Values
| Value | Description |
|---|---|
| Color code or color name | Changes the text color to the specified color. Color codes can be specified using 8-bit, 16-bit, or RGBA color models. For a list of available color names, please refer to the W3C official site. |
Browser Preview
<p style="color: #0000ff;">This is a p element with 'color: #0000ff' specified.</p>
<p style="color: red;">This is a p element with 'color: red' specified.</p>
<p style="color: rgba(0, 0, 0, 0.6);">This is a p element with 'color: rgba(0, 0, 0, 0.6)' specified.</p>
Browser Support
Desktop
Supported in all versions
8 ○
7 ○
6 ○
2 and earlier ×Mobile
Android Browser
4.4+ ○
3 and earlier ×Same support as desktop
Same support as desktop
※ Version data based on MDN.
Overview
Specifies the text color (font color). Color codes or color names can be used. For a list of available color names, please refer to the W3C official site.
Note that the RGBA color model is not supported in IE8 and earlier.
The 'color' property is also explained in this article.
If you find any errors or copyright issues, please contact us.