当我尝试折叠它时,我的Navbar工作正常并且有关于表单的所有内容,它显示了所有内容,包含按钮但不显示菜单项。我不知道为什么。我正在使用Bootstrap 3.3.6。
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mainNavBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Welcome</a>
</div>
<div class="collapse navbar-collapse" id="mainNavBar">
<ul class="nav navbar-nav">
<li><a href="#">Home</a> </li>
<li><a href="#">About</a> </li>
<li><a href="#">Contact</a> </li>
</ul>
</div><!--/.nav-collapse -->
</div>
答案 0 :(得分:0)
It is working fine in Codepen So my guess would be you forgot to include JQuery
or bootstrap.js
in your html page.
You can download JQuery from here.