XML technologies / CSS / Advanced websites with CSS / CSS property reference / background

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The shorthand property background sets all values for an element’s background in a single declaration.

Inherited: no

See also: background-attachment, background-color, background-image, background-position and background-repeat

Values

For the background properties, all allowed values may be specified in any order, separated by spaces. Subproperties without an assigned value automatically receive their default values.

Default value: none

Compatibility

CSS version: 1

Supported by Internet Explorer 4 and later, Netscape 6 and later, Opera 5 and later, and all Mozilla versions. Partially supported by Netscape 4.x, but undocumented and unreliable there.

Example

The following rule creates a white page background with a background image in a fixed position:

body {
  background: #fff url(/images/textur.gif) fixed;
}

  

 

 

 

back to top