Background

Published Aug 6, 2021Updated Sep 9, 2021
Contribute to Docs

The CSS background properties are used to add background wallpaper visuals for HTML elements.

Background

background
Shorthand way of expressing the various background properties of one or more element backgrounds in any order using a single declaration.
background-attachment
Determines if the background image is fixed in relationship to the viewport or whether it will scroll along with the rest of the page.
background-blend-mode
Returns a new blended color based on the background color and the background images.
background-clip
Defines the boundary within the element box at which the background is no longer drawn.
background-color
Defines a color for the background of an element.
background-image
Places one or more images in the background of the element.
background-origin
Specifies the background positioning area of a background.
background-position
Defines the positions of one or more background images relative to the background-origin position. This is the point from which any background repetition will occur.
background-repeat
Defines how the background image should be repeated if the image does not fully cover the element.
background-size
Defines the size of one or more background images.

All contributors

Looking to contribute?

Learn CSS on Codecademy