下拉菜单和显示隐藏的元素的 Z 索引问题
我刚刚将 superfish 添加到 我的页面。但是下拉菜单显示在 我的 header-bottom div 下,其中已显示:隐藏。但这并不是唯一的问题 由我的 Easy Slider 其中有图像和 div,但我无法分辨哪一个覆盖了我的下拉菜单。
我不太熟悉使用 z-index 解决这个问题的最佳方法是什么?
I just added superfish to my page. But the drop down menu displays under my header-bottom div which has display: hidden. But that's not the only problem it is also
covered by my Easy Slider which has images and divs and I can't tell which one is covering my drop down menu.
I'm not very familiar using z-index
What's the best way of solving this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查包含菜单的容器是否具有相对位置。 Z-index 仅适用于位置属性为“相对”或“绝对”的元素。
例如:
Check that container, which contains your menu has relative position. Z-index works only for elements, which has position attribute 'relative' of 'absolute'.
For example:
通过 CSS 在两个元素上添加 z-index 属性。 (菜单)和(滑块)
是的,原因是使用两个带有
position:relative;
的元素Add z-index property on both elements through CSS. (menu) and (slider)
and yes, the reason is using two elements with the
position:relative;