简体   繁体   English

如何禁用Bootstrap 3折叠导航菜单CSS

[英]How to disable Bootstrap 3 collapse nav menu css

I feel bit pathetic asking this question: I have a project based on this bootstrap template . 我问这个问题有点可悲:我有一个基于此bootstrap模板的项目。

I need to prevent the menu icon / stacked responsive mode. 我需要防止菜单图标/堆叠响应模式。 My primary menu is small enough that I don't need it. 我的主菜单很小,我不需要。 I have tried disabling media queries (you'd think that setting one of them to a max width of 1px would do it) and inspecting the DOM, but I can't figure it out. 我曾尝试禁用媒体查询(您可能会认为将其中一个设置为最大宽度为1px即可)并检查DOM,但我无法弄清楚。 Anyone know how I should modify the media so that the collapsed menu is in effect never triggered? 有人知道我应该如何修改媒体,以使折叠菜单实际上不会触发吗?

You could completely delete the button by getting rid the following code, which is inside the navbar-header : 您可以通过删除以下代码(位于navbar-header内部)来完全删除按钮:

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
    <i class="fa fa-bars"></i>
</button>

Then, on the navbar , you must delete the collapse navbar-collapse navbar-main-collapse classes to prevent the menus hiding when the screen size is small. 然后,在navbar ,必须删除collapse navbar-collapse navbar-main-collapse类,以防止在屏幕较小时隐藏菜单。 So, it should look like this: 因此,它应如下所示:

<div class="navbar-right">
    <ul class="nav navbar-nav">
    ...
    </ul>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM