Bootstrap导航栏没有响应。为什么?

时间:2016-02-02 21:24:13

标签: twitter-bootstrap mobile navbar

此导航栏使用bootstrap&它工作正常,但在移动视图中我没有看到导航链接。有什么想法吗?

  <div class="navbar-fixed">
        <nav class="navbar">
          <div class="nav-wrapper container-fluid navbar-collapse navbar-responsive">
            <a href="#" id="nav-logo" class="brand-logo left"><img src="images/_white.png" alt="logo"></a>
            <ul id="nav-mobile" class="right hide-on-med-and-down navbar-collapse">
              <li><a href="#home">Home</a></li>
              <li><a href="#howitworks">How It Works</a></li>
              <li><a href="#esports">E-Sports</a></li>
              <li><a href="#network">Network</a></li>
              <li><a href='#signup'>Sign Up For Beta</a></li>
            </ul>
          </div>
        </nav> <!-- end navigation -->
      </div>

1 个答案:

答案 0 :(得分:0)

希望这有助于你

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Page 1-1</a></li>
            <li><a href="#">Page 1-2</a></li>
            <li><a href="#">Page 1-3</a></li>
          </ul>
        </li>
        <li><a href="#">Page 2</a></li>
        <li><a href="#">Page 3</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
        <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
      </ul>
    </div>
  </div>
</nav>