Home > Software engineering >  Bootstrap 5 navbar toggle not showing on fixed-top
Bootstrap 5 navbar toggle not showing on fixed-top

Time:11-17

I'm using the Bootstrap 5 navbar fixed at the top and the toggle doesn't show when resizing the browser. When I remove the fixed top I can see the toggle. What am I missing?

<nav >
    <div >
        <a  href="#">Name</a>
        <button  type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
            <span ></span>
        </button>
        <div  id="navbarNav">
            <ul >
                <li >
                    <a  aria-current="page" href="index.html">Home</a>
                </li>
                <li >
                    <a  href="`enter code here`">Resume</a>
                </li>
                <li >
                    <a  href="">Linkedin</a>
                </li>
                <li >
                    <a  href="">GitHub</a>
                </li>
                <li >
                    <a  href="">Email</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

putting back the original

navbar-dark bg-dark

will bring back the toggle when resizing the page. I feel like this is so simple and I'm so close.

CodePudding user response:

I figured it out.

I changed

<nav >

to

<nav >

Adding the navbar-dark bg-transparent brought the toggle back.

  • Related