Fandom

HTML & CSS Wiki

Layer-background-color

649pages on
this wiki
Add New Page
Comments0 Share

This browser-specific property is not recommended. Authors should generally find an alternative way to accomplish the same task while adhering to all best practices, or simply do without it if it is unimportant.


The layer-background-color property is used in CSS and certain HTML elements. This property sets the background-color for the entire region of the current element. This proprietary property behaves in Netscape the way the background-color property should behave, while the actual background-color behavior is buggy in this regard. This property was invented to create the correct behavior.

The background-color property only covers the content area of an element's rendering box, and if a border is also used, there is a slight gap (2-3 pixels) between the background-color and the border area, where the background-color of the parent element shines through.

The layer-background-color covers the whole region specified by the element, including the gap area occurring for the background-color property, and the entire dimension of the element specified by the width and height properties. Since this property is only understood by Netscape, and it fixes other buggy behavior, specifying both this and the background-color property with the same value is recommended.

Values

Value Description
<color> Uses valid color names or color codes as the value.
transparent This specifies that the parent element background/image will shine through if one exists, else the system default background/image value is used.


HTML example:

<div style="position:absolute; top:100px; left:300px; width:200px; 
border:thin solid black; background-color:blue; layer-background-color:blue;">
TEXT</div>


CSS example:

div {
     position:absolute;
     top:100px;
     left:300px;
     width:200px; 
     border:thin solid black;
     background-color:blue;  
     layer-background-color:blue;
}

See Also

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.