Nav崩溃在Bootstrap中无效

时间:2015-07-09 11:51:31

标签: html twitter-bootstrap

到目前为止我有这个代码:

在调整窗口大小时,我可以看到导航菜单被更改,但是,单击该按钮时不会显示。 我正在努力找到这段小代码到底出了什么问题。

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>Bootstrap Designing</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <nav id="myNavBar" class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNav">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
       <a class="navbar-brand" href="#">POSist Technologies</a>
    </div>
<!--Navigation Items -->
<div id="myNav" class="collapse navbar-collapse">           
               <ul class="nav navbar-nav" >
               <li class="active"> <a href="" >Home</a> </li>
               <li> <a href="#" >Projects</a>  </li>
               <li> <a href="#" >Clients</a>  </li>
               <li> <a href="#" >About Us</a>  </li>
               <li> <a href="#" >Careers</a>   </li>
               </ul>

              <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Login</a></li>
            </ul>
      </div>
    </nav>
</div>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

没有引用Bootstrap JS来处理所有这些行为。

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>