我正在使用引导程序来设计我的网站。
基于这个小提琴
我把nav-static-top
to 固定在上面。现在nav-collapse
有很多内容,我无法浏览到最后一个菜单,因为nav-static-top
它固定在顶部。有没有办法将其
nav-static-top
固定在顶部并且nav-collapse
内容是可滚动的,以便我可以滚动以选择内容?
我有比这样的东西,但我看起来不太好,我认为 android 设备不支持 overflow:scroll
找到了更好的方法。仅在 iphone 4 上测试。
@media (max-width: 767px) {
.body-container {
padding-top: 50px;
margin-left:10px;
margin-right:10px;
}
.navbar-static-top{
position:fixed;
width:100%;
z-index:1000;
}
.navbar-responsive-collapse{
max-height: 350px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
This doesn't completely fix your problem, but it definitely looks better if you do this:
<div class="nav-collapse collapse navbar-responsive-collapse" style="overflow-y: scroll;max-height:400px">
<ul class="nav">
instead of
<div class="nav-collapse collapse navbar-responsive-collapse">
<ul class="nav" style="overflow: scroll;max-height:400px">
I don't know about doing it on Android, but if it really doesn't work this way, you'll probably have write some JS or something.