[thelist] CSS & Netscape

Aylard JA (James) jaylard at equilon.com
Fri Nov 10 15:45:08 CST 2000


Andrew,

> The box, a div, has a 1px border with a colored inner body.  In Netscape,
> it shows the border and then about 2px of whitespace, showing the text
> underneath the box, and then the colored inner body.  How do I get rid of
> that white space?  I've tried adjusting the margin and adjusting the
> padding but neither works. 

	As you have discovered, getting CSS to work in Netscape 4 can be a
major pain. The short answer to your question is this:

layer-background-color: #cccc99 ;

	This is a proprietary (and very poorly documented) Netscape CSS
property that does what background-color is supposed to do, but it requires
that a value of either absolute or relative be applied to the div (or
"layer", in Netscape parlance) in order to work. I have found that it can be
flaky when applied to a relatively positioned layer, however.
	Since IE (as well as every other browser) does not recognize this
CSS property, it ignores it, allowing background-color and
layer-background-color to coexist peacefully in the same style declaration
(but be sure to set both to the same color). There is a
layer-background-image property as well, btw.

hth,
James Aylard




More information about the thelist mailing list