Click to See Complete Forum and Search --> : z-index difficulties


robindean
06-19-2007, 09:11 AM
I'm reading on some sites that z-index applies to positioned elements.

On other sites I'm reading that it only applies to elements which are positioned absolutely ( position: absolute; ).

If I use position: absolute; on the elements in question, things look bad and don't behave properly.

Is it okay to use position: relative; with z-index?

smyhre
06-19-2007, 10:05 AM
Im not sure exactly if it needs to be position absolute, even though i have read that it does have to be that way, cause i have z-index in my site and im using a lot of relative positioining. And its views relatively the same, still bugs in ie but still working on that. But If you want the best compatability make sure your z-index numbers are starting at 0 and on up firefox doesn't like negative numbers.

robindean
06-19-2007, 10:16 AM
Thanks!

Major Payne
06-20-2007, 12:00 AM
Check out more info on z-index use:

Formatting Model (http://www.w3.org/TR/CSS21/visuren.html#z-index)

Related: Appendex E (http://www.w3.org/TR/CSS21/zindex.html)
background properties (http://www.w3.org/TR/CSS21/colors.html#background-properties)

Ron