B.53. layer-background-color

Longtime users of CSS Positioning will be familiar with Netscape 4's unwelcome penchant for leaving a space between the content of an absolute-positioned block and its border. This three-pixel space is in addition to the padding, and is left transparent, even if the block was assigned a background.

This little-known nonstandard property, which works only in Netscape 4, sets the background color of both the main background area as well as that three-pixel space! Although there is still no way to get rid of that three-pixel space, a browser-specific style sheet can reduce the padding by three pixels to achieve the desired rendering, as long as the intended padding of the box is at least 3 pixels!

If background-color is set as well as layer-background-color, the background-color will fill the content area and actual padding, while the layer-background-color will fill the three-pixel space.

Inherited: No

See also: Section B.4background-color

B.53.1. Value

Any CSS color value.

Initial value: transparent

B.53.2. Compatibility

CSS Version: n/a

Netscape 4 only.

B.53.3. Example

This demonstrates how to achieve identical rendering of a box in standards-compliant browsers and in Netscape 4:

/* This style rule appears in the common style sheet */
#thebox {
  position: absolute;
  padding: 10px;
  border: 1px solid black;
  background-color: red;
}

/* This style rule appears in the NS4-only style sheet */
#thebox {
  padding: 7px;
  layer-background-color: red;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.31.159