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: 
Where URI specifies the location of the image file.
Takes the value of this property from the computed style of the parent element.
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:
        .example {
            background-image: url("bg.jpg");
            background-repeat: repeat;
            width: 300px;
            height: 200px;
            overflow: scroll;
    <div class="example">
        Some content ..... <br /> ..... <br /> ..... <br />
        Some content ..... <br /> ..... <br /> ..... <br />
        Some content ..... <br /> ..... <br /> ..... <br />
        Some content ..... <br /> ..... <br /> ..... <br />
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content