View Full Version : Z-Indexing: Is there a way that works?

02-23-2005, 04:53 PM
On several occasions I've wanted to have different divs appear behind/infront of one another. I have always thought that it's a simple case of adding the Z-Index values with 0 being the one at the back and x being the one in the foreground.

However, even if I try this, it doesn't work. I've tried it in IE and FF.

Is this the way to do it? Is it supported by all the browsers, or just IE?

If this isn't the way to do, how do you do it?

I'm currently having to create a single image to span my page with a transparent section where I want the other layers to appear.

Many thanks in advance,

02-23-2005, 05:00 PM
For z-index to work the element also needs to have the position set, usually to relative or absolute depending on your layout.

02-23-2005, 05:04 PM
That's great! Cheers :thumbsup: I never knew that the position needed to be set.

Thanks alot

02-23-2005, 05:08 PM
No problem... :thumbsup:

Here's some good reading: