Easy Tutorial
❮ Prop Email Pattern Jsref Issafeinteger Number ❯

backgroundColor Property

Style Object

Example

Set the background color of the document:


Definition and Usage

The backgroundColor property sets or returns the background color of an element.


Browser Support

All major browsers support the backgroundColor property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 requires !DOCTYPE to be specified for "inherit" support. IE9 supports "inherit".


Syntax

Set the backgroundColor property:

Return the backgroundColor property:

Property Values

Value Description
color Specifies the background color. In CSS Color Values
inherit The background color is inherited from the parent element.
transparent Default. The background color is transparent (the underlying content will show through).

Technical Details

Default value: transparent
Return value: A string representing the background color
--- ---
DOM Version Core Level 1
--- ---
❮ Prop Email Pattern Jsref Issafeinteger Number ❯