为什么 Openlayers 总是渲染在其他 div 之上?
我无法让 Openlayers div 允许其他 div 出现在其上方。
尝试了此处提出的解决方案以及这里看起来更优雅,我还没有运气。 Openlayers 总是优先于其他 div 排序。我还为我的另一个 div (我想要在顶部)设置了尽可能高的 z-index,但仍然没有效果。
有什么地方可以被覆盖吗?或者一些需要额外技巧才能摆脱的设置?
编辑:没关系,我得到了答案,问题是我忘记放置元素。只需记住添加“位置:相对;” (例如)任何需要 z 索引的元素。把这个问题留在这里供其他人启发,但它已经在其他地方得到了回答。
I'm having trouble getting an Openlayers div to allow other divs to appear above it.
Having tried the solution proposed here as well as the more classy-looking one here, I haven't had any luck yet. Openlayers always orders itself over other divs. I've also set the z-index for my other div (which I want on top) as high as it goes, still no effect.
Is there somewhere it could be getting overridden? Or some setting that needs an extra trick to get rid of?
EDIT: Never mind, I got an answer and the problem was that I forgot to position the element. Just remember to add "position: relative;" (for example) to any element needing a z-index. Leaving this question here for others' edification, but it has been answered elsewhere.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论