Difference between revisions of "CSS GUIDE BACKGROUND COLOR"

From CDOT Wiki
Jump to: navigation, search
(Specification Conformance)
Line 58: Line 58:
== Specification Conformance  ==
== Specification Conformance  ==
* [http://www.w3.org/TR/CSS1#font-family CSS 1]
* [http://www.w3.org/TR/CSS1#background-color CSS 1]
* [http://www.w3.org/TR/CSS21/fonts.html#font-family-prop CSS 2.1]
* [http://www.w3.org/TR/CSS21/colors.html#propdef-background-color CSS 2.1]
* [http://www.w3.org/TR/2002/WD-css3-fonts-20020802/#font-family-prop CSS 3]
* [http://www.w3.org/TR/2002/WD-css3-background-20020802/#properties CSS 3]
== Browser Compatibility ==
== Browser Compatibility ==

Revision as of 13:32, 22 November 2006

This document is a work in progress and is subject to change.


background-color sets the background color of an element, either through a color value or the keyword transparent.

  • Initial value: transparent
  • Applies to: all elements
  • Inherited: no
  • Percentages: N/A
  • Media: visual
  • Computed value: as specified


background-color: color | transparent | inherit

Legal Values


The color can be specified as a hexidecimal RGB value, a regular RGB value, or by using one of the pre-defined color keywords.


The default value for background-color is transparent meaning the element has no color of its own, instead showing the color of the element behind it.

Mozilla Recommended Values

Usage Examples

.exampleone {
	background-color: teal;
	color: white;

.exampletwo {
	background-color: rgb(153,102,153);
	color: rgb(255,255,204);

.examplethree {
	background-color: #666699;
	color: #FFFFFF;


Specification Conformance

Browser Compatibility

See Also