我正在尝试以下HTML在屏幕上添加导航栏。当我调整窗口大小到显示切换按钮的程度时,单击它,什么都不做。 html中缺少什么东西?
由于
<!-- Navigation -->
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#proj-navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project Name</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="proj-navbar">
<ul class="nav navbar-nav">
<li><a href="#">Initiation</a></li>
<li class="active"><a href="#">Implementation</a></li>
<li><a href="#">Close Out</a></li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</nav>
答案 0 :(得分:3)
检查您是否正确链接了bootstrap的css和js文件。这些是可折叠菜单工作所必需的。
https://github.com/twbs/bootstrap/releases/download/v3.3.0/bootstrap-3.3.0-dist.zip
如果你想最小化你的javascript文件,你可以使用可折叠插件,因为响应式菜单取决于它: http://getbootstrap.com/javascript/#collapse