且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IE7将绝对定位的div放在下面,忽略z-index

更新时间:2022-10-18 21:31:08

IE的堆叠顺序算法搞乱了。你必须定位你想要的元素的上层,给它一个位置,如 relative 如果它还没有一个,和一个正z-index。 / p>

这通常会解决它。如果没有,继续尝试父母,直到你得到它。


Have tried to fix this on my own and so far failed.

The yellow auto-completion divs that show up as you start typing in the subject or location field appears below the other text in IE7. This is the website:

http://www.universitytutor.com

Setting a higher Z-index didn't fix it. Works in all other browsers (IE8, FF, Chrome, Safari) but not IE7. Any ideas?

IE's stacking order algorithm is messed up. You have to position the parent of the element you want on top, give it a position like relative if it doesn't already have one, and a positive z-index.

That will usually resolve it. If not, keep trying the parent of that until you get it.