Visit Mozilla.org

DOM:CSS:background

From MDC

« Gecko DOM Reference

[edit] Summary

background is a shorthand method of defining all background characteristics:

Items can be left out at any position and specified in any order.

[edit] Syntax

object.style.background = properties;

[edit] Example

Complete definition:

document.getElementsByTagName( "body" )[0].style.background = "#aaaaaa url(image.jpg) no-repeat fixed center center";

Partial definition:

document.getElementById( "para" ).style.background = "#aaaaaa url(image.jpg) no-repeat";