Style backgroundImage Property
Style backgroundImage Property
The backgroundImage property is used to either set or return the background image of an element. We can also specify background color if the image is not working or unavailable.
Syntax:-
Its syntax is:- object.style.backgroundImage OR object.style.backgroundImage = url(URL)|none|initial|inherit
Return:-
Its return is:- string having the background image
Further Explanation:-
Value | Description |
---|---|
url(URL) | The location of the image file. |
none | No background image. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |