很难描述问题.所以,看看这个jsFiddle:
当导航栏固定在顶部时,内容会跳到它下面.
CSS:
.affix {
position: fixed;
top: 0px;
}
#above-top {
height: 100px;
background: black;
}
Run Code Online (Sandbox Code Playgroud)
问题出在哪儿?
我正在尝试使用图像和菜单链接进行引导菜单,当它滚动时,菜单会粘在窗口的顶部.
我找到了有趣的bootstrap词缀,并使用了这个帖子中的内容: bootstrap-affix:Div下面的词缀"跳转"到顶部.如何让它顺利滚动?
问题是当我按下菜单按钮时,选项位于页面的内容文本下.
我写了一个小提琴,让你看到我的问题并尝试解决方案:http: //jsfiddle.net/mram888/WnPqF/
我试图为菜单div的类添加不同的z-index,但只有在页面滚动并且菜单贴在顶部时才能正常工作.
#nav.affix {
position: fixed;
top: 0;
width: 100%;
z-index:2;
}
#nav > .navbar-inner {
border-left: 0;
border-right: 0;
border-radius: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
}
.nav-wrapper {
z-index: 2;
}
Run Code Online (Sandbox Code Playgroud)
