The background-image property paints one or more images behind an element's content. Each image is a file, written with url(), or a generated image such as linear-gradient() or radial-gradient(). List several images with commas. The first image is painted on top, closest to the reader.
Not deprecated. url(), gradients, and multiple layers are Baseline. element(), the image() type, and paint() are experimental and missing in most browsers.
Point at a file.url() loads an image. This one is a tiny SVG stored in the value, so the example needs no extra file. %23 is the encoded # in each dot color.
Quote the address. The double quotes keep the path one value. A normal project path such as url("images/dot.svg") is resolved from the style sheet, not from the HTML file.
Put a color under it.background-color: #eff6ff fills the gaps and remains if the file cannot load.
The dots repeat. A small image tiles because background-repeat starts at repeat. That tiling is the other property's initial value.
Example 3 — Two Layers
Lay a dark tint over a second fade. The first gradient in the list is on top.
Write two images. A comma splits the list into two layers. Both are gradients, so no file is requested.
The first layer is on top.rgba(15, 23, 42, 0.55) is a translucent dark tint. You still see the fade behind it.
The second layer is behind.linear-gradient(135deg, #0ea5e9, #6366f1) runs from sky blue to indigo on a diagonal.
The color would be last. A background-color would sit under both images. This pair is already opaque, so the tint and the fade are what you see.
Edge Cases & Pitfalls
If the picture is missing, unreadable, or in the wrong order, one of these is usually why.
a11y
Screen readers skip it
Assistive technology is not told about a background image. Information belongs in an img with alt. Use this property for decoration, and keep the text contrast at 4.5:1 against the paint.
color
A failed file is treated as none
If the address 404s, that layer disappears. Set a background-color so something remains. An opaque gradient covers that color; the color is still underneath.
order
The first image is the top image
In url("photo.webp"), linear-gradient(...) the file is on top and the gradient is the backup behind it. Reversing the list hides the file under an opaque gradient.
reset
The background shorthand clears the image
A later background: #fff sets every background longhand, including background-image: none. Set the image after the shorthand, or include the image in the shorthand.
path
url() starts from the style sheet
A path is resolved from the CSS file, not from the HTML page. url("images/dot.svg") in /css/site.css requests /css/images/dot.svg.
Compatibility
Browser Support
background-image is a browser painting property. Node.js, Deno, and Bun do not apply it. url() and none are older than gradients. conic-gradient() is newer. element(), the image() type, and paint() are experimental.
✓ Baseline · Widely available since 2015
background-image
url() and none: every current browser. Multiple layers: Internet Explorer 9+. linear-gradient and radial-gradient: Chrome 26+, Firefox 16+, Safari 7+, Edge 12+. conic-gradient: Chrome 69+, Firefox 83+, Safari 12.1+.
99%url() and gradients
Google Chrome1+ url · 26+ gradients · 69+ conic
Full support
Mozilla Firefox1+ url · 16+ gradients · 83+ conic
Full support
Apple Safari1+ url · 7+ gradients · 12.1+ conic
Full support
Microsoft Edge12+ gradients · 79+ conic
Full support
Opera3.5+ url · 12.1+ gradients
Full support
Samsung Internet4+ gradients · 10+ conic
Full support
Internet Explorer4+ url · 9+ layers · 10+ gradients
Partial
background-imageWidely supported
Bottom line: Safe for url(), multiple layers, linear-gradient(), and radial-gradient() in current browsers. conic-gradient() needs Chrome 69, Firefox 83, or Safari 12.1, and is absent in Internet Explorer. element(), the image() type, and paint() are experimental — skip them on a normal page.
Remember
Key Takeaways
Role: paint one image, or a stack of images, behind the content. Files use url(). Gradients are images too.
Order: the first image in a comma list is on top. background-color is behind all of them.
Initial value:none. It is not inherited. initial clears the image. inherit copies the parent.
Meaning: screen readers ignore it. Put information in an img with alt. Keep a fallback color.
One line:background-image chooses the picture. Repeat, size, and position only change how that picture sits in the box.
Frequently Asked Questions
It paints one or more images behind an element's content. The image can be a file, a gradient, or a comma-separated stack. The text stays on top. The initial value is none, and the property is not inherited.
none. The element has no background image until you set one. A background-color can still show, because the color is a different property and is painted underneath.
Yes. linear-gradient(), radial-gradient(), and conic-gradient() produce images. An opaque gradient covers the background-color. A transition swaps one image for another; it does not cross-fade, because the animation type is discrete.
The first image in the list is painted closest to the reader. The next image sits behind it. The background-color sits behind every image.
Browsers do not expose background images to assistive technology. If the picture carries information, use an img element with alt text. Keep background-image for decoration, and keep text contrast strong against the picture.
url() and none work in every current browser and in old Internet Explorer. Multiple layers need Internet Explorer 9 or newer. Standard linear-gradient and radial-gradient need Chrome 26, Firefox 16, Safari 7, or Edge 12. conic-gradient needs Chrome 69, Firefox 83, or Safari 12.1. This is a browser CSS property. Node.js, Deno, and Bun do not paint it.