Open main menu

CDOT Wiki β

Changes

CSS GUIDE BACKGROUND COLOR

2,142 bytes added, 13:15, 22 November 2006
no edit summary
<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 ==
'''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 ==

<pre>
background-color: color | transparent | inherit
</pre>

== 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 ==

<pre>
.exampleone {
background-color: teal;
color: white;
}

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

.examplethree {
background-color: #666699;
color: #FFFFFF;
}
</pre>

== Notes ==

* [http://www.webreference.com/html/reference/color/named.html Valid color names you can use in HTML and CSS instead of numerical color values]
* [http://www.webreference.com/html/reference/color/propcolor.html Proprietary color names used by Internet Explorer and their numerical equivalents]
* [http://www.webreference.com/html/reference/color/websafe.html 216-color Websafe palette and the 22-color Reallysafe palette]
* [http://www.html-color-codes.com/ Several Colour Charts]
* [http://www.w3schools.com/html/html_colornames.asp 147 color names supported by popular browsers]

== Specification Conformance ==

* [http://www.w3.org/TR/CSS1#font-family CSS 1]
* [http://www.w3.org/TR/CSS21/fonts.html#font-family-prop CSS 2.1]
* [http://www.w3.org/TR/2002/WD-css3-fonts-20020802/#font-family-prop CSS 3]

== Browser Compatibility ==

== See Also ==

* [http://www.w3.org/TR/REC-CSS2/colors.html#background-properties W3 CSS 2]
1
edit