Skip to content
Related Articles
Open in App
Not now

Related Articles

How to set background-image for the body element using CSS ?

Improve Article
Save Article
  • Last Updated : 23 Dec, 2020
Improve Article
Save Article

In this article, we set the image into the background using CSS property. The background-image property is used to set one or more background images to an element. By default, it places the image on the top left corner. To specify two or more images, separate the URLs with a comma.


background-image: url("url");

Property value: It holds the URL of an image that you want to use as background image.



<!DOCTYPE html>
        How to set background-image for
        the body element using CSS ?
        body {
            background-image: url(
            text-align: center;
    <h1 style="color: white;">
        Set background-image for
        the body element


Supported Browsers:

  • Google Chrome 1.0
  • Edge 4.0
  • Firefox 1.0
  • Opera 3.5
  • Safari 1.0
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!