Open links in new tab
    • Work Report
    • Email
    • Rewrite
    • Speech
    • Title Generator
    • Smart Reply
    • Poem
    • Essay
    • Joke
    • Instagram Post
    • X Post
    • Facebook Post
    • Story
    • Cover Letter
    • Resume
    • Job Description
    • Recommendation Letter
    • Resignation Letter
    • Invitation Letter
    • Greeting Message
    • Try more templates
  1. 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!

    This 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!
    • url("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!
    Feedback
  2. 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.

  3. 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 …

  4. 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 …

  5. 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 …

  6. 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 …

  7. 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.

  8. 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 …

  9. 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 …

  10. 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 …