# Property Description

The background-color property sets the background color of an element. This includes the side of the element + padding + border.

# Property Values

Value | Description
--- | ---
color_name | Specifies the background color with a color name
hex_number | Specifies the background color with a hex code
rgb_number | Specifies the background color with an RGB code
transparent | (default) Specifies that the background color should be transparent.
inherit1 | Specifies that the value of the property should be inherited from the parent element

# Examples

This example shows how to specify the background-color of different elements.

    body {
      background-color:red;
    }

    h1 {
      background-color:#ffff00;
    }

    p {
      background-color:
        rgb(255,255,0);
    }

# Browser Support

Firefox | IE | Chrome | Opera | Safari

1 - 'inherit' not supported by IE

# Miscellaneous Information

Inherited: | No
Defined In: | CSS1