CSS - Background


CSS - Background

  • In this chapter, we will teach how to set backgrounds of various HTML elements. 
  • The CSS background properties are used to define the background outcome for html elements.

Background Properties :

The CSS background Properties are :

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

Background Color :

  • It is used to set the background color of an element like <p>,<h1>,<h2>.

Background Image :

  • It is used to set the background image for the body.

Background-Repeat :

  • In CSS, Background-repeat property is used to control the repetition of an image in the background.

Background-Attachment :

  • Background attachment property will fix the image in the page even if you scroll down image will be visible. 

Background-Position :

  • &It is used to control the position of an image in the background.