You are here: Reference > CSS > properties > background-image

background-image property

Browser support:
Specifies the image to use as the background of the object.
JavaScript page for this property: backgroundImage. You can find other example(s) there.

Possible values:

 One of the following values: 
url(URI)
Where URI specifies the location of the image file.
inherit
Takes the value of this property from the computed style of the parent element.
none
Default. Specifies that the current element does not have a background image.
Default: none.

Example HTML code 1:

This example illustrates the use of the background-image property:
<head>
    <style>
        .example {
            background-image: url("bg.jpg");
            background-repeat: repeat;
            width: 300px;
            height: 200px;
            overflow: scroll;
        }
    </style>
</head>
<body>
    <div class="example">
        Some content ..... <br /> ..... <br /> ..... <br />
        Some content ..... <br /> ..... <br /> ..... <br />
        Some content ..... <br /> ..... <br /> ..... <br />
        Some content ..... <br /> ..... <br /> ..... <br />
    </div>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content