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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

z-order not working properly?

Status
Not open for further replies.

NFI

Programmer
Jun 7, 2000
278
GB
Hiya,

Can anyone shed any light on this for me, please?

I've written a page that make heavy use of the z-order and absolute positioning style elements and it's just not working properly. It seems that the layering order of elements on the page is actually dependent upon what order they are put into the code - something like this:

<html>
<img src='blah_01' style='position:absolute;z-order:1>
<img src='blah_02' style='position:absolute;z-order:2>
</html>


Image blah_01 appears under blah_02, which is what you'd expect. If, however, I do this:

<html>
<img src='blah_02' style='position:absolute;z-order:2>
<img src='blah_01' style='position:absolute;z-order:1>
</html>


...now image blah_02 appears under blah_01 - the z-order tag is being ignored and the order in which they appear in the code is defining the layering...

Now, this wouldn't be so bad - I could get around it - but if I now try to interact in some way with image blah_02 (like an onclick event or something) I can't, as it's under blah_01...very annoying :(

So what's going on? Why can't I get z-order to work and why is the code order having such an effect?

Obviously, this is a pretty weird problem, so any help or advice or even ideas will be much appreciated :)

Thanks,

Paul
 
I have never heard of a z-order property. The css attribute for stacking order of layers is z-index. This works nicely for me (I tried switching and changing and it behaved as expected):
Code:
<html>
 <img src="image1.jpg" style="position:absolute; z-index: 2;" />
 <img src="image2.jpg" style="position:absolute; z-index: 1;" />
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top