z-index问题与twitter bootstrap下拉菜单 [英] z-index issue with twitter bootstrap dropdown menu

查看:129
本文介绍了z-index问题与twitter bootstrap下拉菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在页面顶部的固定导航栏中使用twitter bootstrap下拉菜单。

I'm using twitter bootstrap dropdown menu in a fixed navbar at the top of my page.

一切正常,但下拉菜单中出现问题

It all works fine but am having issues with the drop down menu items showing behind other page elements rather than in front of them.

如果我在页面上有任何位置:相对(如jquery ui手风琴或谷歌图表),然后下拉菜单显示在其后面。尝试更改dd菜单和导航栏的 z-index ,但没有任何区别。

If I have anything on the page with position: relative (like jquery ui accordion, or a google chart) then the drop down menu shows behind it. Tried changing the z-index of the dd menu and of the nav-bar, but doesn't make any difference.

我可以让菜单位于其他内容上方的唯一方法是将内容更改为 position:fixed; OR z-index :-1; - 但这两个解决方案都会导致其他问题。

The only way I can get the menu to sit above the other content is to change the content to position: fixed; OR z-index: -1; -but both of these solutions cause other problems.

欣赏任何您可以给我的帮助。

Appreciate any help you can give me.

我认为这可能是我被误解的CSS定位的一些标准问题,所以没有发布任何代码,但是如果需要,可以做。

I think this is probably some standard issue with CSS positioning that I've misunderstood, so haven't posted any code, but can do if needed.

谢谢。

推荐答案

只是意识到发生了什么。

Just realized what's going on.

我有一个标题中的导航栏是 position:fixed ;

I had the navbar inside a header which was position: fixed;

更改了标题中的 z-index ,现在正在工作 - 猜我看起来不够高最初设置 z-index 的容器#@ !?

Changed the z-index on the header and it's working now - guess I didn't look high enough up the containers to set the z-index initially !#@!?

谢谢。

这篇关于z-index问题与twitter bootstrap下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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