color

The color property specifies the foreground color of an element's text content.

Syntax

color: <color> | inherit
Initial: depends on user agent
Applies To: all elements
Inherited: yes
Percentages: NA
Media: visual

Values

color: value
Value Description
color Keyword or a numerical RGB (Red Green Blue) specification

DOM

[window.]document.getElementById("element-id").style.color = "color";

Example | color

Example | DOM

External

W3C Cascading Style Sheets, level 1

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification