twitter-bootstrap – 引导3级崩溃菜单

前端之家收集整理的这篇文章主要介绍了twitter-bootstrap – 引导3级崩溃菜单前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有没有人能为我提供一个基本的3级崩溃菜单的引导导航栏?
我不打算打开第三级.有人可以调整我的代码添加第三级吗?

这是我有两个级别的菜单

<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>

      <div class="nav-collapse">
        <ul class="nav">
          <a class="brand" href="#">Present Ideas</a>
          <li class="active"><a href="#">Home</a></li>
          <li><a href="#">Blog</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Help</a></li>
          <li class="dropdown" id="accountmenu">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">Account Settings<b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#">Login</a></li>
              <li><a href="#">Register</a></li>
              <li class="divider"></li>
              <li><a href="#">logout</a></li>
            </ul>
          </li>
        </ul>
        <ul class="nav pull-right">

        </ul>
      </div>
      <!--/.nav-collapse -->
    </div>
  </div>
</div>

我以为像:

<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>

      <div class="nav-collapse">
        <ul class="nav">
          <li class="active"><a href="#">Home</a></li>
          <li><a href="#">Blog</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Help</a></li>
          <li class="dropdown" id="accountmenu">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">Account Settings<b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#">Login</a></li>
              <li class="item-148 dropdown parent">
                <a href="/about/learn-more">Learn more&nbsp;<b class="caret-right"></b></a>
                <ul class="dropdown-menu">
                  <li class="item-149"><a href="/about/learn-more/the-software">The Software</a></li>
                  <li class="item-150"><a href="/about/learn-more/the-project">The Project</a></li>
                  <li class="item-151"><a href="/about/learn-more/the-leadership">The Leadership</a></li>
                  <li class="item-152"><a href="/about/learn-more/open-source-matters">Open Source Matters</a></li>
                </ul>
              </li>
              <li class="divider"></li>
              <li><a href="#">logout</a></li>
            </ul>
          </li>
        </ul>
        <ul class="nav pull-right">

        </ul>
      </div>
      <!--/.nav-collapse -->
    </div>
  </div>
</div>

但这不行

解决方法

Bootstrap 2.3.x及更高版本支持下拉菜单.
<ul class="dropdown-menu">
            <li><a href="#">Login</a></li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">More options</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Second level</a></li>
                    <li><a href="#">Second level</a></li>
                    <li><a href="#">Second level</a></li>
                </ul>
            </li>
            <li><a href="#">logout</a></li>
</ul>

Working demo on Bootply.com

原文链接:https://www.f2er.com/bootstrap/234076.html

猜你在找的Bootstrap相关文章