是否有一个上限的z-index值在Web浏览器? [英] Is there an upper limit to z-index values in web browsers?
问题描述
我在那里有一个第三方的广告是通过我的模式窗口实现出血的情况。我想起来模式叠加尽可能高的z索引所以广告不会在它的上面显示。是否有z-index的值有限制吗?我敢肯定,如果没有它由浏览器的不同而不同。任何人都知道?
I have a case where a 3rd party ad is bleeding through my modal window implementation. I'd like to up the z-index of the modal overlay as high as possible so the ad won't show on top of it. Is there a limit to z-index values? I'm sure if there is it varies by browser. Anyone know?
推荐答案
记住,的z-index
不工作的全局,而只是一种堆积范围内'(其具有难以消化的CSS 定义的),并且如果所述广告建立它的自己的堆叠上下文,则的z-index
值设置在其他地方可能不会影响它。
Keep in mind that z-index
doesn't work globally, but only within a 'stacking context' (which has hard to digest definition in CSS), and if the ad establishes it's own stacking context, then z-index
values you set elsewhere may not affect it at all.
不过更可能是窗口闪光的问题(对象而不的wmode =透明
属性),该浏览器呈现的一切之上,仿佛是一个窗口以上浏览器窗口的。在这种情况下的z-index
将于事无补。你需要给力的广告[-provider]使用的wmode =透明
或使用一些疯狂的黑客是iframe。
However more likely it's an issue of "windowed" Flash (object without wmode=transparent
attribute), which browsers render on top of everything, as if was a window above browser's window. In such case z-index
won't help at all. You'll need to force ad[-provider] to use wmode=transparent
or use some crazy hacks with iframes.
这篇关于是否有一个上限的z-index值在Web浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!