Css 引导移动导航,想要;在“上落”;现有内容(z索引)
我有一个使用bootstrap的移动导航,我想在现有内容下降时将其折叠(而不是将内容向下推) 我已经试过在我能想到的所有东西上设置Css 引导移动导航,想要;在“上落”;现有内容(z索引),css,twitter-bootstrap,position,z-index,Css,Twitter Bootstrap,Position,Z Index,我有一个使用bootstrap的移动导航,我想在现有内容下降时将其折叠(而不是将内容向下推) 我已经试过在我能想到的所有东西上设置位置:相对和z-index:9999: @media (max-width: 768px) { .navbar-collapse { width: 200px; float: right; position: relative !important; z-index: 9999 !important; } .navbar {
位置:相对和z-index:9999
:
@media (max-width: 768px) {
.navbar-collapse {
width: 200px;
float: right;
position: relative !important;
z-index: 9999 !important;
}
.navbar {
width: 200px;
float: right;
position: relative !important;
z-index: 9999 !important;
}
.collapse {
position: relative !important;
z-index: 9999 !important;
}
}
到目前为止,一切都不起作用,有人知道修复方法吗?您不应该在导航栏中使用诸如“相对”之类的属性。如果您使用引导固定导航栏,那么您将能够实现您想要的结果
<nav class="navbar navbar-default navbar-fixed-top">
下面是一个类似这样的例子
我想这样做,但不幸的是导航不能固定在屏幕顶部,它需要保持向上滚动并保持在页面顶部。
.navbar-static-top {
position:absolute;
width:100%;
}