1. Home
  2. Computing & Technology
  3. Web Design / HTML

background-image

By Jennifer Kyrnin, About.com

background-image Description:

The background-image property defines the background image of the element.

background-image in CSS Versions:

background-image Syntax:

background-image: <url> | none | inherit

  • <url>
    The path to the image used as the background.
  • none
    No background image should display.
  • inherit
    The element should have the same background-image setting as the parent.

background-image Initial Value:

none

background-image Applies To:

All elements.

background-image Inheritance:

This property is not inherited.

background-image Browser Support:

background-image Examples:

Standard background-image property

<p style="background-image : /library/graphics/purple.gif;">
This paragraph has the purple.gif image as a background.
</p>

background-image Special Notes:

  • The background-image property only reliably works in the <body> tag in many browsers.
  • It's a good idea to set the background-color as well, that will be used when the image is unavailable.
  • Any background image specified will be overlayed above the background-color.

More background-image Information:

Return to the Style Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: background-image

©2008 About.com, a part of The New York Times Company.

All rights reserved.