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

background

By Jennifer Kyrnin, About.com

background Description:

The background property is a short-hand property to describe all the background properties for an element at once.

background in CSS Versions:
background Syntax:

background: [ <background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position> ] | inherit

background Initial Value:

0% 0%

background Applies To:

All elements.

background Inheritance:

This property is not inherited.

background Browser Support:
background Examples:

set all the attributes

<p style="background : #ccc url(/library/graphics/purple.gif) repeat-y scroll center;">
This paragraph has the purple.gif image as a background that starts tiling in the center of the element and tiles only vertically. Where the image doesn't display has a grey background color.
</p>
background Special Notes:
  • The background property only reliably works in the <body> tag in many browsers.
  • If you write background: none; no background image or color will be used.
More background Information:

Return to the Style Library

Explore Web Design / HTML
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. About.com Web Design A to Z
  5. Books
  6. About Web Design Book
  7. AWD: Chapter 12
  8. CSS Style Property: background>

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

All rights reserved.