Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

css stacking order

Status
Not open for further replies.

dakota81

Technical User
May 15, 2001
1,691
US
I was trying to write a page that uses a stacking order but cannot get the page to work concurrently in IE & Mozilla/Netscape. I may just write my page in a different way, but still am curious as to why I can't figure this out.

I'm using the z-index property to define the stacking order. I want an image to be placed in the background with text above it. When I set the images z-index to 0 & the text's z-index to 100, everything looks fine in Mozilla, but the image is above the text in IE. If I set the images z-index to -1, everything looks find in IE, but the image does not appear in Mozilla.

How do I get a stacking order that works in both browsers? Can someone check these pages in Netscape 7 for me (I've got Mozilla 1.3a)? Here's links to the two pages:

 
Out of more trial and error I was able to deduce that there are two things involved in this:

1) You need to set the position property to absolute or relative as is stated all over the place on the internet. However, to get them to function properly, they must be consistant in their declerations, i.e. use only all relatives or only all absolutes.

2) Netscape/Mozilla still doesn't handle a z-index of -1 properly and thus should be avoided if possible (especially when the boss uses Netscape 7!).

Someone comment on this if I'm not entirely correct here?
 
why don't you just set the legs image as a b/g image and use a style sheet to stop it repeating?? Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
I was able to get it to work by following the two points I figured out and listed above. And yeah, there are several ways I could have written that page, but regardless I wanted to know how to properly set up a stacking order.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top