Name

color — NN 4 IE 4 CSS 1

Synopsis

Inherited: Yes

Defines the foreground text color of the element. For some graphically oriented elements, such as form controls, the color attribute may also be applied to element edges or other features. Such extra-curricular behavior is browser-specific and may not be the same across browsers.

CSS Syntax

color: color

JavaScript Equivalent

color

Value

See the discussion of color attribute values at the beginning of this chapter.

Initial Value

black

Example

TH {color: darkred}

Applies To

All elements.

Object Model Reference

IE

[window.]document.all.elementID.style.color

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.