The background property is a so called shorthand property that is used to set background-color, background-image, background-attachment, background-position and background-repeat properties at the same place.

Before applying the background property all background-related properties are first reset to their default values.

The background property contains following information:

  1. value: [<'background-color'>, <'background-image'>, <'background-attachment'>, <'background-position'>, <'background-repeat'>] or inherit;
  2. initial: depends on individual properties;
  3. applies to: all elements;
  4. inherited: no;
  5. percentages: allowed on background-position;
  6. media: visual;
  7. computed value: depends on individual properties.

If a value is not mentioned that should set that property to its initial value.

Example

CSS background property example:

 

›› go to examples ››