XML technologies / CSS / Advanced websites with CSS / CSS property reference / color
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property color describes an element’s foreground colour. It also sets the default colour for the element’s border.
Whenever an element’s foreground colour is set, its background colour should also be defined, and vice versa. This prevents problems with the user’s browser settings.
Inherited: yes
See also: background-color
Values
Any valid CSS colour value.
Default value: black
Compatibility
CSS version: 1
Works in all CSS-capable browsers, including Internet Explorer 4 and later, Netscape 4 and later, and Mozilla.
Example
The following style rule displays all paragraphs on the page as white text on a tomato-red background.
p {
color: white;
background-color: #ff6347;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg