CSS background-image Property
Description
The background-image property in CSS is used to set one or more images as the background of an element. These images can dramatically influence the visual presentation of a web page, allowing designers to create textured, patterned, or photographic backdrops without adding extra HTML elements. Unlike content images placed in <img> tags, background images are purely decorative by default, meaning they do not carry semantic meaning and are not part of the document’s content flow. This distinction is important for accessibility, as screen readers typically ignore background images, emphasizing the need for meaningful alternative text in HTML when conveying information visually.
One of the powerful aspects of background-image is its ability to layer multiple images. When multiple images are specified, they are stacked in order, with the first image listed appearing on top. This capability allows for complex visual effects, such as overlaying textures over a photograph or combining gradient images with decorative patterns. To control the positioning and repetition of these layers, the property is often used in conjunction with other background-related properties such as background-repeat and background-position. These properties provide fine control over how each image is displayed, whether it should repeat to fill the space, or be positioned precisely within the container.
Background images also interact with CSS layout and sizing in significant ways. The property does not affect the element’s size or layout directly; instead, the image is painted behind the element’s content, meaning elements like text, borders, and padding are displayed on top. For responsive design, background images can be combined with properties like background-size to scale or fit images dynamically within their container. This allows designers to create visually engaging layouts that adapt to different screen sizes without sacrificing image quality or disrupting the content structure. Additionally, background images can work with transparency, gradients, and CSS blend modes to create advanced visual effects, enhancing the creative flexibility of modern web design.
Definition
- Initial value
- none
- Applies to
- All elements
- Inherited
- No
- Computed value
- As specified, but with URIs made absolute
- Animatable
- No
- JavaScript syntax
- object.style.backgroundImage
Interactive Demo
Syntax
background-image: <bg-image> [ , <bg-image> ]*
Values
- <image>Is an <image> denoting the image to display. There can be several of them, separated by commas, as multiple backgrounds are supported.
- noneColor of the next parent through which the background is visible.
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS background-image property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
