[html] How to make a 3-level collapsing menu in Bootstrap?

I am trying to make a 3-level collapsing navbar menu for Bootstrap, but I can't open the third level.

This is the two level menu which I have:

_x000D_
_x000D_
<link href="https://stackpath.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"/>_x000D_
<div class="navbar navbar-fixed-top">_x000D_
  <div class="navbar-inner">_x000D_
    <div class="container">_x000D_
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">_x000D_
        <span class="icon-bar"></span>_x000D_
        <span class="icon-bar"></span>_x000D_
        <span class="icon-bar"></span>_x000D_
      </a>_x000D_
_x000D_
      <div class="nav-collapse">_x000D_
        <ul class="nav">_x000D_
          <a class="brand" href="#">Present Ideas</a>_x000D_
          <li class="active"><a href="#">Home</a></li>_x000D_
          <li><a href="#">Blog</a></li>_x000D_
          <li><a href="#">About</a></li>_x000D_
          <li><a href="#">Help</a></li>_x000D_
          <li class="dropdown" id="accountmenu">_x000D_
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">Account Settings<b class="caret"></b></a>_x000D_
            <ul class="dropdown-menu">_x000D_
              <li><a href="#">Login</a></li>_x000D_
              <li><a href="#">Register</a></li>_x000D_
              <li class="divider"></li>_x000D_
              <li><a href="#">Logout</a></li>_x000D_
            </ul>_x000D_
          </li>_x000D_
        </ul>_x000D_
        <ul class="nav pull-right">_x000D_
_x000D_
        </ul>_x000D_
      </div>_x000D_
      <!--/.nav-collapse -->_x000D_
    </div>_x000D_
  </div>_x000D_
</div>
_x000D_
_x000D_
_x000D_

I thought something like this would work:

_x000D_
_x000D_
<link href="https://stackpath.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"/>_x000D_
<div class="navbar navbar-fixed-top">_x000D_
  <div class="navbar-inner">_x000D_
    <div class="container">_x000D_
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">_x000D_
        <span class="icon-bar"></span>_x000D_
        <span class="icon-bar"></span>_x000D_
        <span class="icon-bar"></span>_x000D_
      </a>_x000D_
_x000D_
      <div class="nav-collapse">_x000D_
        <ul class="nav">_x000D_
          <li class="active"><a href="#">Home</a></li>_x000D_
          <li><a href="#">Blog</a></li>_x000D_
          <li><a href="#">About</a></li>_x000D_
          <li><a href="#">Help</a></li>_x000D_
          <li class="dropdown" id="accountmenu">_x000D_
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">Account Settings<b class="caret"></b></a>_x000D_
            <ul class="dropdown-menu">_x000D_
              <li><a href="#">Login</a></li>_x000D_
              <li class="item-148 dropdown parent">_x000D_
                <a href="/about/learn-more">Learn more&nbsp;<b class="caret-right"></b></a>_x000D_
                <ul class="dropdown-menu">_x000D_
                  <li class="item-149"><a href="/about/learn-more/the-software">The Software</a></li>_x000D_
                  <li class="item-150"><a href="/about/learn-more/the-project">The Project</a></li>_x000D_
                  <li class="item-151"><a href="/about/learn-more/the-leadership">The Leadership</a></li>_x000D_
                  <li class="item-152"><a href="/about/learn-more/open-source-matters">Open Source Matters</a></li>_x000D_
                </ul>_x000D_
              </li>_x000D_
              <li class="divider"></li>_x000D_
              <li><a href="#">Logout</a></li>_x000D_
            </ul>_x000D_
          </li>_x000D_
        </ul>_x000D_
        <ul class="nav pull-right">_x000D_
_x000D_
        </ul>_x000D_
      </div>_x000D_
      <!--/.nav-collapse -->_x000D_
    </div>_x000D_
  </div>_x000D_
</div>
_x000D_
_x000D_
_x000D_

But that's not working.

This question is related to html css twitter-bootstrap menu

The answer is


Bootstrap 2.3.x and later supports the dropdown-submenu..

<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


Bootstrap 3 dropped native support for nested collapsing menus, but there's a way to re-enable it with a 3rd party script. It's called SmartMenus. It means adding three new resources to your page, but it seamlessly supports Bootstrap 3.x with multiple levels of menus for nested <ul>/<li> elements with class="dropdown-menu". It automatically displays the proper caret indicator as well.

<head>
   ...
   <script src=".../jquery.smartmenus.min.js"></script>
   <script src=".../jquery.smartmenus.bootstrap.min.js"></script>
   ...
   <link rel="stylesheet" href=".../jquery.smartmenus.bootstrap.min.css"/>
   ...
</head>

Here's a demo page: http://vadikom.github.io/smartmenus/src/demo/bootstrap-navbar-fixed-top.html


Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to css

need to add a class to an element Using Lato fonts in my css (@font-face) Please help me convert this script to a simple image slider Why there is this "clear" class before footer? How to set width of mat-table column in angular? Center content vertically on Vuetify bootstrap 4 file input doesn't show the file name Bootstrap 4: responsive sidebar menu to top navbar Stylesheet not loaded because of MIME-type Force flex item to span full row width

Examples related to twitter-bootstrap

Bootstrap 4: responsive sidebar menu to top navbar CSS class for pointer cursor How to install popper.js with Bootstrap 4? Change arrow colors in Bootstraps carousel Search input with an icon Bootstrap 4 bootstrap 4 responsive utilities visible / hidden xs sm lg not working bootstrap.min.js:6 Uncaught Error: Bootstrap dropdown require Popper.js Bootstrap 4 - Inline List? Bootstrap 4, how to make a col have a height of 100%? Bootstrap 4: Multilevel Dropdown Inside Navigation What is the hamburger menu icon called and the three vertical dots icon called? Changing text color of menu item in navigation drawer How to get selected value of a dropdown menu in ReactJS Android custom dropdown/popup menu Creating a Menu in Python How to make a 3-level collapsing menu in Bootstrap? how to set active class to nav menu from twitter bootstrap How to make jQuery UI nav menu horizontal? Twitter Bootstrap add active class to li Adding a right click menu to an item