导航栏崩溃不工作bootstrap 3.3.6

时间:2018-03-02 03:00:54

标签: html css twitter-bootstrap css3 twitter-bootstrap-3

我想让我的导航向下折叠虽然它已经关闭但是当我再次单击该按钮以恢复它时它不起作用。

  <div class="menu-btn-respons-container">
          <button id="menu-btn" type="button" class="navbar-toggle btn-navbar collapsed" data-toggle="collapse" data-target="#main-menu .navbar-collapse">
            <span aria-hidden="true" class="icon_menu hamb-mob-icon"></span>
          </button>
     </div>


<div id="main-menu" class="font-raleway">
  <div class="navbar navbar-default" role="navigation">
    <nav class="collapse collapsing navbar-collapse right-1024">
      <ul class="nav navbar-nav">
        <li>Link 1</li>
        <li>Link 2</li>
      </ul>
    </nav>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

我编辑了你的代码,这应该可行。

<nav class="navbar navbar-expand-md navbar-light bg-light fixed-top">
    <a class="navbar-brand" href="#"></a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarsExampleDefault">
        <ul class="navbar-nav mr-auto">
            <li>Link 1</li>
            <li>Link 2</li>
        </ul>
    </div>
</nav>