CSS Background

christian.dinh's avatar
Published Aug 6, 2021Updated Sep 9, 2021
Contribute to Docs

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

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • In this CSS tutorial, you’ll learn how to add CSS to visually transform HTML into eye-catching sites.
    • Beginner Friendly.
      6 hours

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

Contribute to Docs

Learn CSS on Codecademy

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • In this CSS tutorial, you’ll learn how to add CSS to visually transform HTML into eye-catching sites.
    • Beginner Friendly.
      6 hours