Export (0) Print
Expand All
top
Expand Minimize

background-color

Sets the color behind the content of the object.

Syntax

{ background-color: sColor }

Possible values

sColor

Variant that specifies 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:

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

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) Ee341494.xtlink_newWindow(en-us,Expression.40).png.

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

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions

ADD
Show:
© 2015 Microsoft