- ✕This summary was generated using AI based on multiple online sources. To view the original source information, use the "Learn more" links.
The background-image property in CSS is used to set one or more images as the background of an element. By default, the image repeats to cover the entire element, but you can control its position, size, and repetition with other background-related properties.
Example:
body {background-image: url("background.jpg");background-repeat: no-repeat;background-position: center;background-size: cover;}Copied!✕CopyThis sets a centered, non-repeating background image that scales to cover the entire viewport.
Basic Syntax
selector {background-image: url("image_path") | none | initial | inherit;}Copied!✕Copyurl("path") – Specifies the image file location.
none – No background image.
initial – Resets to default (none).
inherit – Inherits from parent element.
Multiple Backgrounds You can layer multiple images by separating them with commas. The first listed image is drawn on top:
div {background-image: url("top-layer.png"), url("bottom-layer.jpg");}Copied!✕Copy CSS Background Image - W3Schools
CSS background-image The background-image property specifies an image to use as the background of an element. By default, the image is repeated so it covers the entire element.
See results only from w3schools.comW3Schools Pathfinder
W3Schools Pathfinder helps users navigate through web development and …
RWD Viewport
W3Schools offers free online tutorials, references and exercises in all the major …
CSS Opacity
CSS Image Opacity The opacity property specifies the opacity/transparency of an …
CSS Variables
CSS Variables The var() function is used to insert the value of a CSS variable. CSS …
background-image CSS property - CSS | MDN - MDN Web Docs
Apr 20, 2026 · Each background image is specified either as the keyword none or as an <image> value. To specify multiple background images, supply multiple values, separated by a comma.
background-image - CSS-Tricks
Feb 17, 2015 · The background-image property in CSS applies a graphic (e.g. PNG, SVG, JPG, GIF, WEBP) or gradient to the background of an element. There are two different types of images you can include …
How to Set Background Image in CSS? - GeeksforGeeks
Sep 10, 2024 · In CSS, there are various ways to set the background image: The simplest and most basic method to set the background image is by using the …
CSS Background Image (With Examples) - Programiz
In the above example, we have used two background images (girl avatar image and dark blue background image) to set the background of the body element. The first …
CSS background-image Property - W3docs
What are the properties of CSS that can be used to control the background image of an element? The CSS background-image property specifies background images …
CSS background-image Property - CSS Portal
Learn about the background-image CSS Property. View description, syntax, values, examples and browser support for the background-image CSS Property.
Styling Background of Elements Using CSS - Tutorial …
Background plays an important role in the visual presentation of a web page. CSS provide several properties for styling the background of an element, including …
CSS background-image Property: How to include a CSS
Dec 27, 2025 · CSS (Cascading Style Sheets) provides a wealth of tools to customize background images, giving you incredible control over their appearance and …
CSS Style backgroundImage Property: CSS Background …
Feb 17, 2025 · A comprehensive guide to the CSS backgroundImage property, covering syntax, values, examples, and best practices for adding and styling …