CSS Background Property

Reference on the CSS Background Property.

The background property sets the background for a given element, in one declaration.

Possible Values

Using this property, you can specify both the background-color, background-image, background-attachment, and background-position.

To understand the many different values for color, Consult the Reference entry on Colors

body {
  background: red url("MyBackground.png") fixed no-repeat top left;
}

Which is the equivalent of:

body {
  background-color: red;
  background-image: url("MyBackground.png");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: top left;
}

Inherited? - NO!

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.