bootstrap top Navbar隐藏菜单项

时间:2014-09-11 18:37:13

标签: twitter-bootstrap

我将bootstrap升级到3.2.0,但菜单项不可见。所以我查看了navbar的最新示例。我尝试在示例中使所有内容相同/相似,但无论如何它都无法正常工作。我有相同的css和js库。 这是我的导航栏:

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".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="/">ABettingTips.com</a>
        </div>
        <div class="nav-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="/tips/">Tips</a></li>
                <li><a href="/tips/stats/">Stats</a></li>


                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        lucas03
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="/admin">Admin</a></li>
                        <li><a href="/accounts/password/change/">Change password</a></li>
                        <li><a href="/accounts/timezone/">Change timezone</a></li>
                        <li><a href="/accounts/logout/?next=/tips/">Logout</a></li>
                    </ul>
                </li>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                <script>alert(toTimeZone("2014-09-11T20:32:56.455558+02:00", "Europe/Bratislava"))</script>
                Current Timezone: Europe/Bratislava (<span id="time"></span>)
                <a href="/accounts/timezone/">change</a>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</div>

这是bootstrap示例:

<!-- Fixed navbar -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".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="#">Project name</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li class="divider"></li>
                <li class="dropdown-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a href="../navbar/">Default</a></li>
            <li><a href="../navbar-static-top/">Static top</a></li>
            <li class="active"><a href="./">Fixed top</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

这是my page。我错过了什么?

谢谢大家的帮助!

3 个答案:

答案 0 :(得分:2)

首先,您可以更改

nav-collapse

navbar-collapse

查看文档http://getbootstrap.com/components/#navbar

只需查看您的班级名称

即可

答案 1 :(得分:2)

您错误输入了

<div class="nav-collapse collapse">

已经为bootstrap 3改为此

<div class="navbar-collapse collapse">

答案 2 :(得分:2)

<div class="navbar-collapse collapse">而不是<div class="nav-collapse collapse">