Twitter Bootstrap Navbar菜单滚动 [英] Twitter Bootstrap Navbar menu scrolling
问题描述
在移动设备上,使用twitter bootstrap 3
时,菜单nabber
具有水平和垂直滚动条.
While using twitter bootstrap 3
, on mobile devices menu nabber
has horizontal and veritcal scrollers.
2.3
中没有该功能,我无法弄清楚如何禁用它,而使菜单项扩展到没有任何滚动条的全部位置.
It was not there with 2.3
and I couldn't figure out how to disable it and let the menu items extend to full without any scroll-bars.
推荐答案
这是Bootstrap 3的新功能.
This is new to Bootstrap 3.
执行此操作的最佳方法是删除/less/navbar.less中的第52和53行或将其注释掉:https://github.com/twbs/bootstrap/blob/master/less/navbar.less#L52-53 (您可以选择删除第59行)并重新编译引导程序.less.
The best way to do this would be to remove or comment out lines 52 and 53 in /less/navbar.less: https://github.com/twbs/bootstrap/blob/master/less/navbar.less#L52-53 (you can optionally remove line 59) and recompile bootstrap.less.
如果无法使用CodeKit或Grunt之类的工具重新编译Bootstrap,则需要在css文档中编写一个媒体查询,该查询可以单挑并覆盖.navbar-collapse类,如下所示:
If you can't recompile Bootstrap with a tool like CodeKit or Grunt, you'll want to write a media query in your css document that singles out and overwrites the .navbar-collapse class maybe like this:
@media (max-width: 767px) {
.navbar-collapse {
max-height: auto;
overflow-x: auto;
}
}
我实际上没有在上面测试过该代码-因为我能够重新编译.您可能必须包含!important或类似的内容.
I haven't actually tested that code above - as I was able to recompile. You may have to include !important or something like that.
这篇关于Twitter Bootstrap Navbar菜单滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!