...

View Full Version : NS4 backgound color CSS



prezbedard
06-22-2002, 07:21 PM
this works in NS6 and IE5 but not in
NS4

basiclly it is supposed to
create a spot on the page that is white
but it does work in NS4.

according to topstyle this is a NS4 property


#behind {
position:absolute;
background:white;
top:100px;
left:0px;
width:200px;
height:100px;
z-index : auto;
}
<div id="behind"></div>

Does anybody know why this isn't displying properly in NS4?

I have tried using
background-color:white;
but no good either


Thanks

La Gal
06-22-2002, 07:31 PM
#behind {
position:absolute;
background:white;
layer-background-color:white;
top:100px;
left:0px;
width:200px;
height:100px;
z-index : auto;
}
<div id="behind"></div>

prezbedard
06-22-2002, 07:53 PM
Thanks but it is still not working.

<STYLE type="text/css"> <!--
#behind {
position:absolute;
background:white;
layer-background-color: White;
top:100px;
left:0px;
width:200px;
height:100px;

}
-->
</STYLE>

<div id="behind"></div>

La Gal
06-22-2002, 08:08 PM
Oops, forgot the clip values that NS4 needs. Don't ask me why, lol.

<STYLE type="text/css"> <!--
#behind {
position:absolute;
background:white;
layer-background-color: White;
top:100px;
left:0px;
width:200px;
height:100px;
clip:rect(0,200,100,0);
}
-->
</STYLE>

Try that.

prezbedard
06-22-2002, 08:50 PM
Thanks so much ,La Gal

can't believe such a minor detail take so much to get to work.

so these are only necessary in NS4 if you want to specify a background color for the id in a div tag ?

layer-background-color: White;
clip:rect(0,200,100,0);

La Gal
06-22-2002, 09:37 PM
Yes. NS4 will only show the background color on the part of a div that has content. IE and NS6 do not have this problem. So you need to use a workaround. Using layer-background-color along with clip:rect values is one way to get around it.

I believe another solution would be give the div a solid border of 0.1px. Such a narrow border would not show up on either browser but would cause NS4 to fill in the div with the background color even if there is no content in the div. However, I donít find this second solution preferable because of another bug in NS4 that causes a small space (about 3px) between the border and any content you do have in the div. *sigh*

Of course you could also fill the div with non breaking spaces, but that would be very tedious.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum