twitter-bootstrap Bootstrap 下拉菜单:删除滚动条

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31291034/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 22:55:03  来源:igfitidea点击:

Bootstrap DropDown Menu: Remove Scrollbar

csstwitter-bootstrapdrop-down-menuscrollbarcollapse

提问by HaeNaatch

I'm working in following GitHub-Repo.

我正在关注GitHub-Repo

When the window width decreases,the navbar collapses and changes to a dropdown menu with scrollbars (for width and heigth).

当窗口宽度减小时,导航栏会折叠并变为带有滚动条(用于宽度和高度)的下拉菜单。

How can I remove those scrollbars?

如何删除这些滚动条?

I tried adding

我尝试添加

.navbar-collapse{
max-height:auto;
max-widht:auto;
}

to my css file which handles the collapsing size.

到我处理折叠大小的 css 文件。

回答by Cristi Draghici

Another solution is adding the following to your CSS:

另一种解决方案是将以下内容添加到您的 CSS:

/* No scrolling for collapsed menu */

.navbar-collapse.in {
    overflow: hidden;
    max-height: none !important;
    height: auto !important;
}

回答by Izzy

Change your css to

将您的 css 更改为

.navbar-collapse.in {
overflow: hidden;
}

Demo

演示

回答by Cris in Motion

Try this

试试这个

.navbar-collapse {
    max-height:100%;
}