value: <color>|inherit
initial value: depends on the user agent (the browser)
inherited: yes
percentages: N/A
applicable to: all elements

The color attribute defines the color of the text for the specified element. This can be the text for the entire <body> tag, a heading tag such as <h2>, all if the text within a <div>, all of the <td> elements in a table, etc.

To specify the color, you can use hexidecimal colors, defined color names, RGB or RGBA colors.

Visit the CSS Rules: Specifying Colors to learn about the allowed colors for text, background, borders, etc.

In the example below, all of the text within the <body> will be a dark grey of #444. The <h2> elements will all be a dark red of rgb(125, 0, 34) and the <p> tags will be the standard green. All of the text within the <div class="quotebox"> will be a blue color, except if it is a <h2> or a <p> tag, then the other styles will override the last style.


body {color: #444;}
h2 {color: rgb(125,0,34);}
p {color: green}
div.quotebox {color: #0022CF}