May 2003
Intermediate to advanced
480 pages
10h 9m
English
This property sets the foreground (text) color of the element. This property also defines the default border color of the element.
In general, you should always specify a background color when you specify a foreground color, and vice versa.
Inherited: Yes
See also: Section B.4background-color
Any CSS color value (see Appendix D).
Initial value: black
CSS Version: 1
Works in all CSS-compatible browsers including Internet Explorer 4 or later, Netscape 4 or later, and Mozilla browsers.
This style rule sets paragraphs of class warning to have white text on a tomato red background.
p.warning {
color: white;
background-color: #ff6347;
}
Read now
Unlock full access