首页 > 代码库 > 折叠导航
折叠导航
1.引入js插件和bootstrap.min.js,bootrap.min.cs文件
2.实现代码如下:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="http://www.mamicode.com/index.html" class="navbar-brand logo"><img src="http://www.mamicode.com/img/logo.png" alt="aaaaa"></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="http://www.mamicode.com/index.html"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
<li><a href="http://www.mamicode.com/information.html"><span class="glyphicon glyphicon-list"></span> 资讯</a></li>
<li><a href="http://www.mamicode.com/case.html"><span class="glyphicon glyphicon-fire"></span> 案例</a></li>
<li><a href="http://www.mamicode.com/about.html"><span class="glyphicon glyphicon-question-sign"></span> 关于</a></li>
</ul>
</div>
</div>
</nav>
折叠导航