CSS background-image Property
The background-image property allows you to display an image as the background for an element.
Possible Values
- url - the path to the location of the image to be used, written as :
background-image: url(path to image file) - none - no background image - the default value.
- inherit - the background image is inherited from the parent element.
NOTE: the image path must be enclosed in single quotes.
Example code using an image with the name "clouds.jpg" located in the same folder as the page:
{background-image: url(clouds.jpg)}
Result when added to a <div> element:
