Sets or retrieves the color behind the content of the object.

Syntax

{ background-color: sColor }

Possible values

sColor

Variant that specifies or receives one of the following values:

transparent

Default. Color of the next parent object through which the background is visible.

color

Any valid HTML color value.

This property has a default value of transparent. It is not inherited.

Remarks

This property can be set with the other background properties by using the background composite property.

Examples

The following example uses the background-color property to specify the background color. This example uses an inline style sheet to set the background color to beige:

 Copy Code
<span style="font-size: 14pt; background-color: beige;">
. . . 
</span>

Standards information

Applies to

A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEFAULTS, DFN, DIV, DL, DT, EM, FIELDSET, FORM, HN, HTML, I, IFRAME, IMG, INPUT TYPE=BUTTON, INPUT TYPE=CHECKBOX, INPUT TYPE=FILE, INPUT TYPE=IMAGE, INPUT TYPE=PASSWORD, INPUT TYPE=RADIO, INPUT TYPE=RESET, INPUT TYPE=SUBMIT, INPUT TYPE=TEXT, LI, OL, OPTION, P, S, SELECT, SPAN, SUB, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

See also