Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

using the z-index property

Aug 19, 2007 7:02AM PDT

Hello, I would like to know how to use the z-index property of css. I tried simply setting the z-index of a div to a value but nothing seems to be happening, so I'm guessing there's a specific way to do it.

An example of what I'm trying to do is here...http://www.studios29.com/cantaflor
I have a div right between my header and my content (nav is inside it), that is called header_bottom and holds the gradient image that you can see right below the header. I want my nav to be on top of that div.

Thank You.

Discussion is locked

- Collapse -
z-index
Aug 21, 2007 8:25AM PDT

Instead of using the z-index you can try setting a negative top margin for this div, say #header_bottom {margin-top: -1;}. Try experimenting with the numbers.

Swisse

- Collapse -
yeah
Aug 22, 2007 4:41AM PDT

interesting...I'll try it out.
I figured out the answer to my question already, what I had to do was to set the div which will have the z-index property to have a absolute position thing.
But I'll try you idea too, thanks.