Name
background-image — NN 4 IE 4 CSS 1
Synopsis
Inherited: No
Sets the background image (if any) for the element. If you set a
background-color for the element as well, the
color appears if the image fails to load; otherwise, the image
overlays the color. Transparent pixels of the image allow a
background color to show through. See also the
background-attachment attribute.
CSS Syntax
background-image: uri | noneJavaScript Equivalent
backgroundImage
Value
To specify a URL, use the url() wrapper for the
attribute value. You can omit the attribute or specify
none to prevent an image from loading into the
element’s background.
Initial Value
none
Example
H1 {background-image: url(watermark.jpg)}Applies To
All elements.
Object Model Reference
- IE
[window.]document.all.elementID.style.backgroundImage
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access