CSS2 - Background Properties

This is a complete reference guide for web developers where we have listed all the CSS properties related to background defined in the World Wide Web Consortium's Recommended Specification for Cascading Style Sheets, Level 2.

Click any property to see its description with examples −

Sr.No. Property & Description
1 background

Composite property for the following properties −

  • background-attachment
  • background-color
  • background-image
  • background-position
  • background-repeat
2 background-attachment

Determines if the background image is fixed in the window or scrolls as the document scrolls.

3 background-color

Sets the background color of an element.

4 background-image

Sets the background image of an element.

5 background-position

Sets the initial position of the element's background image, if specified; values normally are paired to provide x, y positions; default position is 0% 0%.

6 background-repeat

Determines how the background image is repeated (tiled) across an element.