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;
}

  

 

 

 

back to top