<div class="colloapse navbar-collapse" id="responsive-navbar">这里面放入要折叠起来的东西</div>
代码:
<!doctypoe html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" data-toggle="collapse" data-target="#responsive-navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand">www.<strong>google</strong>.com</a>
</div>
<div class="collapse navbar-collapse" id="responsive-navbar">
<ul class="nav navbar-nav">
<li class="active"><a href="">课程</a></li>
<li><a href="">博客</a></li>
<li><a href="">手册</a></li>
</ul>
<a href="" class="btn btn-primary btn-sm navbar-btn navbar-right">订阅课程</a>
<div class="profile navbar-right">
<ul class="nav navbar-nav ">
<li><a href="">登录</a></li>
<li><a href="">注册</a></li>
</ul>
<p class="navbar-text">
Hello, <a href="#" class="navbar-link">Deng</a>
</p>
</div>
</div>
</div>
</nav>
<div class="container" style="height:5000px;">
<div>
<h1>title123</h1>
<p>按时打算是多少对阿斯达方的方式斯蒂芬斯蒂芬按时打算</p>
</div>
</div>
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>
效果: