1. Computing

Discuss in my forum

background

By , About.com Guide

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 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:

©2013 About.com. All rights reserved.