Forum Moderators: not2easy

Message Too Old, No Replies

Need to fix z-index

Need help with a hack to fix a z-index... in IE 7 (no, not IE6)

         

thetechgeek

5:40 am on Mar 16, 2008 (gmt 0)

10+ Year Member



Hey all,
I'm having a bit of trouble with my website. I'm not making it to work with IE6. I've given up on that. If they're viewing it with IE6, I'm just putting up a dumbed-down version of my site up. But what's weird is that, even when I specify a z-index, IE7 still renders the "prefs_box" div under my text that has the default z-index. This may be that I'm loading the text through a javascript function. But I dunno. If you know a hack that makes IE render something on the very top of the page, that would be great.

Thanks *so* much for any help.

P.S. -
I'm willing to get my hands dirty with a hack. I'm just about ready to give up on making my site work at all with IE.

[edited by: tedster at 5:45 am (utc) on Mar. 16, 2008]
[edit reason] no personal urls, thanks [/edit]

DrDoc

5:41 am on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are the "z-index" elements positioned at all?

MarkFilipak

5:56 am on Mar 16, 2008 (gmt 0)

10+ Year Member



> ...give up on making my site work at all with IE.
Not necessary if you do things right.

The z-indexed elements have to be either {position:relative} or {position:absolute}.
Explicit {z-index:0} sets a new z-context for this element and all of its children.
{z-index:0} is behind {z-index:1}, is behind {z-index:2}, ...

DrDoc

6:02 am on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please note that a z-index value of zero may exhibit unspecified behavior in certain UAs. A couple older versions treated <body> as "z-index: 1" and thus would place anything with "z-index: 0" behind, effectively hiding it from view.

And doesn't

position: fixed
allow for z-index layering as well? Can't remember, as I've never had to worry about that ... but I am fairly certain it does.

And, if you are having trouble with IE -- are you using a full doctype? If you are, have you looked into the "easy route" by including Dean Edwards fantastic IE7 CSS fix [dean.edwards.name]?

[edited by: SuzyUK at 12:37 pm (utc) on Mar. 16, 2008]
[edit reason] fixed broken link [/edit]