z索引在ie8中工作,而不是在ie7中工作 [英] z-index working in ie8, not ie7

查看:89
本文介绍了z索引在ie8中工作,而不是在ie7中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,z-index在IE8中可用于一个特定元素,但在IE7中则不起作用(或者如果我在IE8中使用伪IE7兼容性视图).它适用于所有其他元素.唯一的区别是此元素的Z索引值为负,因此我尝试使用1的正数,但它仍然是唯一无法正常工作的元素.

For some reason, z-index is working for one particular element in IE8, but not in IE7 (or if I use the pseudo IE7 compatibility view while in IE8). It's working for all of the other elements. The only difference is that this element has a negative z-index, so I tried using a positive one of 1 and still, it's the only one not working.

不起作用的部分是这样的:

The part that's not working is this:

.passport {
    position: absolute;
    left: -130px;
    z-index: -2;
}

它被附加到该图像上,该图像应该位于其他所有内容的下方:

And it's attached to this image that's supposed to be underneath everything else:

<img src="http://www.blahblahblah.com/image.png" class="passport">

其他所有东西都具有从2到2的正z索引(这就是为什么我在尝试正数以查看是否有帮助时使用1作为索引的原因)的原因.就像现在的代码一样,该图像位于IE8中的所有其他内容的下面,但是就像我说的那样,不在IE7中.那不是图像的实际路径,顺便说一句,我只是出于隐私目的在这里更改了它.

Everything else, has positive z-index from 2 and up (which is why I used 1 for the index when trying a positive one to see if that helped). As the code is now, this image IS underneath everything else in IE8, but like I said, not in IE7. That's not the actual path of the image, btw, I just changed it here for privacy purposes.

关于可能是什么原因的任何想法?我一直在网上看到的唯一解决方案是解决根本无法使用的z-index或不能在IE7中使用但不能在IE8中使用的解决方案,当我发现一个似乎很接近的解决方案时,该解决方案无济于事,因为它建议使用位置:静态(我不能,因为我需要它是绝对的)或其他与此无关的东西,因为它与下拉菜单和javascript以及混合在一起的所有其他事情.

Any idea on what could be causing it? The only solutions I keep seeing on the web are addressing z-index that doesn't work at all or works in IE7 but not IE8 and when I find one that seems close, the solution doesn't help me because it's suggesting to use position: static (which I can't because I need this to be absolute) or other things that have nothing to do with this because it's with dropdown menus and javascript and all sort of other things in the mix.

我要处理的只是图像堆叠,仅此而已.我发现可以帮助我理解的一件事是该网站,但是我不明白通过不同的堆叠上下文"意味着什么. http://css-discuss.incutio.com/wiki/Overlapping_And_ZIndex

All I'm dealing with is images stacking, nothing else. The one thing I found that might help me understand is this website, but I don't understand what it means by different stacking "context". http://css-discuss.incutio.com/wiki/Overlapping_And_ZIndex

我不知道这是否真的与我的问题有关,但我认为我想问一下这有什么帮助.否则,一般的问题是,这在IE8中有效,但在IE7中无效,我想知道为什么会这样吗?

I don't know if it would actually be relevant to my issue, but I figured I'd ask what it means in case it can help. Otherwise, the general issue is that this works in IE8 but not IE7 and I was wondering why that might be?

同样,我已经搜索过,因此,如果这是一个简单的答案,我就错过了.谢谢!

Again, I have searched, so if it's a simple answer I just missed it. Thanks!

推荐答案

在这里看看: IE 6& IE 7 Z索引问题

这篇关于z索引在ie8中工作,而不是在ie7中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆