search

Home  >  Q&A  >  body text

Why doesn't my Bootstrap navigation bar render correctly?

I'm trying to make a navigation bar using Bootstrap 4, but my code doesn't seem to work. My code is almost identical to the tutorial, with just a few changes to nav-brand. What did i do wrong? This is what it looks like.

<nav class="navbar sticky-top navbar-light bg-light">
<a class="navbar-brand" href="/">
    <img src="/assets/logo/logo.svg" width="30" height="30" class="d-inline-block align-top"
        alt="">
    <b class="hojasdeplata">Fourteen Trees</b>
</a>
<ul class="navbar-nav">
    <li class="nav-item active">
        <a class="nav-link" href="#">Active</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
    </li>
    <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
    </li>
</ul>
P粉121081658P粉121081658441 days ago932

reply all(1)I'll reply

  • P粉541565322

    P粉5415653222023-09-17 00:16:26

    Turns out I needed to move the nav-brand into a div with the other nav.

    reply
    0
  • Cancelreply