Difference between revisions of "CSS GUIDE BACKGROUND COLOR"

From CDOT Wiki
Jump to: navigation, search
(Specification Conformance)
m (Reverted edits by Paralogizing (Talk) to last revision by Mdsouza)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span style="margin:0;background:#ffff33;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;">This document is a work in progress and is subject to change.</span><br /><br />
 
 
 
== Summary ==
 
== Summary ==
 
'''background-color''' sets the background color of an element, either through a color value or the keyword ''transparent''.
 
'''background-color''' sets the background color of an element, either through a color value or the keyword ''transparent''.
Line 21: Line 19:
 
'''color'''  
 
'''color'''  
  
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 color can be specified as a hexidecimal RGB value, a regular RGB value, or by using one of the pre-defined color keywords.
  
 
'''transparent'''  
 
'''transparent'''  
  
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.
+
* 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 ==
 
== Mozilla Recommended Values ==

Latest revision as of 23:34, 26 July 2010

Summary

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

Syntax

background-color: color | transparent | inherit

Legal Values

color

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

transparent

  • 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;
}

Notes

Specification Conformance

Browser Compatibility

See Also