XML technologies / CSS / Advanced websites with CSS / CSS property reference / layer-background-color
(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 little-known proprietary property layer-background-color specifies a background colour for the content, including the three-pixel gap described above.
The best results come from combining background-color and layer-background-color. The colour declared for background-color then fills the content area and padding, while the colour declared for layer-background-color fills the three-pixel gap.
Inherited: No
See also: background-color
Values
Any valid CSS colour value.
Default value: transparent
Compatibility
CSS version: not part of the CSS standard
Works only in Netscape 4.
Example
The following rules give a red background to the HTML element positioned with absolute and identified by gefuelltebox. 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-color: red;
}
/* Diese Stilregel steht im Stylesheet nur fuer Netscape 4 */
#gefuelltebox {
padding: 7px;
layer-background-color: red;
}
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