Bootstrap导航栏无法正常工作

时间:2015-05-21 22:04:50

标签: twitter-bootstrap collapse

可崩溃的部分不会工作。 (这部分)

http://imgur.com/PWpHE1G

如果有人可以提供帮助,我会非常感激。感谢所有试图提供帮助的人。 这是代码

<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="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="#">Connor Clarke</a>
    </div>
    <div id="navbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav">
        <li><a href="../index.html">Home</a></li>
        <li class="active"><a href="#">Games</a></li>
        <li><a href="#contact">About</a></li>
      </ul>
    </div><!--/.nav-collapse -->
  </div>
</nav>

这是链接

感谢任何可以提供帮助的人

1 个答案:

答案 0 :(得分:1)

这样可以正常使用 DEMO

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<nav class="navbar navbar-inverse" role="navigation">
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" 
      data-target="#example-navbar-collapse">
    <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="#">Refat Rafi</a>
  </div>
  <div class="collapse navbar-collapse" id="example-navbar-collapse">
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">HOME</a></li>
      <li><a href="#">Education</a></li>
      <li><a href="#">About Me</a></li>
      <li><a href="#">Education</a></li>
      <li><a href="#">Skills</a></li>
    </ul>
  </div>
</nav>