我正在使用 bootstrap 来设计我的网站。
基于此fiddle
我将 nav-static-top
固定在顶部。现在 nav-collapse
有很多内容,我无法浏览到最后一个菜单,因为 nav-static-top
固定在顶部。有没有办法
nav-static-top
固定在顶部并且 nav-collapse
内容是可滚动的,所以我可以滚动以选择内容?
我比 this但我看起来不太好
我认为 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;
}
}
关于javascript - Bootstrap :Fixed nav-static-top on top but scrollable nav-collapse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17561824/