CSS background-image Property

The css background-image property is used to set one or more background images for an element. By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally. The background of an element is the total size of the element, including padding and border excluding the margin. It can be used with background-color property which will be used if the image is unavailable.

CSS background-image Example

body {
background-image: url(“background_img.gif”);
background-color: #f0f0f0;
}

Multiple Background Images

You can set multiple background images for an element using following syntax.

background-image: url(“background_img.gif”), url(“background_img2.gif”);