XML technologies / CSS / Advanced websites with CSS / CSS property reference / layer-background-image
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
Experienced users of CSS positioning will know Netscape 4’s annoying habit of creating a gap between the content and border of an element positioned with absolute. This three-pixel gap is additional to the padding and remains transparent even when the element has a background colour or image.
Netscape’s proprietary property layer-background-image assigns a background image to the content, including the three-pixel gap described above.
The best results come from combining background-image and layer-background-image. The image declared for background-image then fills the content area and padding, while the image declared for layer-background-image fills the three-pixel gap.
Inherited: No
See also: background-image
Values
A URL (url()) or none.
Default value: none
Compatibility
CSS version: not part of the CSS standard
Works only in Netscape 4.
Example
The following rules assign the background image to the HTML element positioned with absolute and identified by gefuelltebox: checker.gif. The additional rule gives Netscape 4 the same result as the first rule alone in standards-compliant browsers:
/* Diese Stilregel steht im allgemeinen Stylesheet */
# gefuelltebox{
position: absolute;
padding: 10px;
border: 1px solid black;
background-image: url(/images/checker.gif);
}
/* Diese Stilregel steht im Stylesheet nur fuer Netscape 4 */
# gefuelltebox{
padding: 7px;
layer-background-image: url(/images/checker.gif);
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg