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

z index problems with IE

Status
Not open for further replies.

adam55

Programmer
Jun 18, 2004
8
US
I'm having the problem that a dynamically created element (using document.createElement()) is always showing over a static element (inline html element), regardless of their z indexes. Does anyone know a good workaround?

Thanks in advance,
Adam

PS. I'm not talking about the problem where select boxes will always show over div's.
 

adam55 said:
I'm having the problem that a dynamically created element (using document.createElement()) is always showing over a static element (inline html element), regardless of their z indexes

Any element that is appended to the end of the document will invariably appear above most other things, as source order rules kick in, I imagine.

You should still be able to control its z-index perfectly well, so it's possible that what you're experiencing (with not being able to set the z-index properly) is a mis-understanding of the way z-index works.

z-indexes are only relative to other elements at the same sibling level as the one you're trying to position. So if you're trying to set the z-index of a newly created element, it will be relative to its siblings in the DOM - trying to set the z-index of it relative to any other elements will be a fruitless exercise.

Hope this helps!
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top