Home > front end >  Issue with Bootstrap Navbar Toggle Button not working
Issue with Bootstrap Navbar Toggle Button not working

Time:04-27

Wondering why my Bootstrap toggler isn't working. Viewed a few other thread on a similar issue appearing, but didn't find an appropriate solution since everything seems in order.

  <body>
      <nav >
        <div >
        <a href="#" >Frontend Bootcamp</a>\
        <button
        
        type="button"
        data-bs-toggle="collapse"
        data-bs-target="#navmenu"
      >
          <span ></span>
        </button>
        <div  id="navmenu">
          <ul >
            <li >
              <a href="#learn" >What You'll Learn</a>
            </li>
            <li >
              <a href="#questions" >Questions</a>
            </li>
            <li >
              <a href="#instructors" >Instructors</a>
            </li>
          </ul>
        </div>
      </div>
      </nav>
</html>

CodePudding user response:

if you are questioning why your icon does not appear, it's because of it's color, use text-white class to make it visible (or add .navbar-inverse to your navbar)

if your collapse is not working it's probably because you did not link bootstrap.js in your project

https://jsfiddle.net/mahdiar_mansouri/3u5jvw1d/5/

this fiddle is based on your code, it has the icon visible (two icons actually, one from bs itself another from bootstrap icon package) and it's collapse is working fine

  • Related