1. Computing

Discuss in my forum

background-image

By , About.com Guide

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:

©2013 About.com. All rights reserved.