Difference between revisions of "CSS GUIDE BACKGROUND IMAGE"

From CDOT Wiki
Jump to: navigation, search
Line 38: Line 38:
== Notes ==
== Notes ==
See [#Mozilla Recommended Values]
See [[Mozilla Recommended Values]]
== Specification Conformance  ==
== Specification Conformance  ==

Revision as of 13:05, 22 November 2006


The background image property is used to set the background image for a given element.

Applicability:The background image property can be used for all CSS elements.
Media Group: Visual


TARGET_ELEMENT {background-image: url | none ;}

Legal Values

urlA URL path to an image file to be used as the background image.
noneSpecifies that no background image is to be used.

Mozilla Recommended Values

It is strongly recommended that developers should specify a background-color to be used if a given image is not available. This is similar to placing alternate text for images.t available. Background images are rendered in the foreground (i.e on top of the background color). This should be considered when using images with transparent background.

Usage Examples

body { background-image: url("images/mybackground.png"); }

p { background-image: none; }


See Mozilla Recommended Values

Specification Conformance

CSS 2.1

Browser Compatibility

See Also