By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Background Properties

Reference linking to the Background Properties of CSS, and their useful Example.

Edited: 2011-11-09 13:47

These are the CSS specifications, used specifically to specify the background of element. You can use them to control whether a background should repeat, have a fixed attachment, and even its position.

The shorthand version is listed at the top, and allows you to easily enter all the declarations, its recommended that you use this whenever possible.

Below sets all the background properties of a div element, in a single declaration.

The CSS background properties

  1. background
  2. background-color
  3. background-image
  4. background-attachment
  5. background-repeat
  6. background-position
  7. Background-size
  8. Background-origin

A short example

#Basement {
  background: #ffffff url("MyBackground.png") fixed no-repeat top left;