Position: static saves the day
Mar. 9th, 2009 10:47 pmI love when IE6 throws me complete wtf moments - z-index (as far as I know) does not apply to static elements. You have to position it somehow, whether relative or absolute or what (I actually have never tried it on fixed elements, don't use that much). But here I was getting a bug where an absolutely positioned element with a z-index of 10000 was working properly in Firefox and IE7 and in IE6 was magically behind the layout container div.
I tried putting position: relative; on the containing div with a z-index: 1; but that did not work. IE7 started exhibiting the same behavior as IE6 and was dropping the menu behind the whole container. Cue almost freak out mode.
Then on a whim (because it takes all of 3 seconds to do) I just put position: static, and it does the proper thing in every browser :D Yay!! (Now I'm just confused, because the containing div had no styles on it at all and I don't see how it would have been inheriting anything weird... but I'm just going to send away a "Whatever!" to the IE6 gods.)
I tried putting position: relative; on the containing div with a z-index: 1; but that did not work. IE7 started exhibiting the same behavior as IE6 and was dropping the menu behind the whole container. Cue almost freak out mode.
Then on a whim (because it takes all of 3 seconds to do) I just put position: static, and it does the proper thing in every browser :D Yay!! (Now I'm just confused, because the containing div had no styles on it at all and I don't see how it would have been inheriting anything weird... but I'm just going to send away a "Whatever!" to the IE6 gods.)