Fandom

HTML & CSS Wiki

Layer-background-image

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 CSS layer-background-image property sets the background-image for the entire region of the current element. This property behaves in Netscape the way the background-image property should behave, because this property was invented to create the correct behavior.

The background-image 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-image and the border area, where the surface of the parent element shines through.

The layer-background-image covers the whole region specified by the element, including the gap area occurring for the background-image 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-image property with the same value is recommended.

Values

Value Description
URL Specifies the URL of the image.
none No background image is used.


HTML example:

<div style="position:absolute; top:100px; left:300px; width:200px; 
border:thin solid black; background-image:url('http://www.example.com/bg.gif');
layer-background-image:url('http://www.example.com/bg.gif');">
TEXT</div>


CSS example:

div {
     position:absolute;
     top:100px;
     left:300px;
     width:200px;
     border:thin solid black;
     background-image:url("http://www.example.com/bg.gif");
     layer-background-image:url("http://www.example.com/bg.gif");
}

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.