CSS background-image property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS background-image property adds an image as the background of an element. More than one images can also be used (subsequently lying over each other) as the background with the first one on top and the last one at the bottom.
background-color should also be used to preserve the contrast between the image layer and other content when the image is not available.
Syntax
background-image : none | url(), url(),...
Property values
url()
-
This value represents the address of an image that is used as the background of an element.
- Try it
background-image: url(img/web4college.png); url(), url()
-
These two URLs represent the address of two different images with the first one on top and the second one at the bottom.
- Try it
background-image: url(img/web4college.png), url(img/background.jpg);
Applicable to
It applies to all elements