Sets the background image of the object.


{ background-image:sLocation}

Possible values


String that specifies one of the following values:


Default. Color of the next parent element through which the background is visible.


Location of the background image, where sUrl is an absolute or relative URL.

This property has a default value of none. It is not inherited.


The URL identifies the image file. When setting a background image, you can set a background color to use when the image is unavailable. When the image is available, it overlays the background color.

This property can be set with other background properties by using the background composite property.


The following example uses the background-image property to specify the background's image. This example uses a call to an embedded (global) style sheet to show and hide the background image:

    .setUrl  { background-image: url(sphere.jpg); }
    .loseUrl { background-image: url(none); }
<span style="font-size: 14;" onmouseover="this.className='setUrl'" onmouseout="this.className='loseUrl'">
. . . 

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) Ee371196.xtlink_newWindow(en-us,Expression.40).png.

Applies to

a, address, b, big, blockquote, body, button, caption, center, cite, code, col, colgroup, custom, dd, defaults, dfn, div, dl, dt, em, fieldset, form, hn, html, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, li, ol, option, p, s, select, span, sub, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var, xmp

See also



Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.