CSS Background


The background-image property in CSS allows you to add multiple background images to an element. The various background images are separated by commas and stacked on top of each other, with the first image closest to the viewer.

CSS can be used to insert multiple background images for an element into an HTML page. To add multiple background images for an element in any pattern, use the CSS background property and other CSS properties to set the height and width of the images.

The used background property are listed below:

1. background-image: 

This property is used to assign the element one or more background images, separated by commas.

Example

Preview

2. background-repeat:

This property controls the repetition of background images. The background image can be repeated horizontally and vertically.

Example

Preview

3. background-position:

This property is used to specify the location of various images on the page. It determined the starting position for each background image.

Example

Preview

4. background-size:

This property specifies the size of the background image for the element.

Example

Preview