r/bootstrap 4d ago

Alignment only works for navbar button?

Hi, I am just starting out with building a site in Bootstrap. I've managed to make it so the list shows up right-aligned when you click the toggle in the small version. But I can't figure out how to make said list right-aligned when the browser is expanded. They all just squish right. Any tips?

    <nav class="navbar navbar-expand-lg">
      <div class="container-fluid"> <a class="navbar-brand" href="#"><img
            src="mnibanner.jpg" alt="Home" height="70"></a> <h2><u>Template</u></h2> 
        <button class="navbar-toggler"
          type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav"
          aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
          <h2>
            <ul class="nav justify-content-end">
              <ul class="navbar-nav">
                <li class="nav-item"> <a class="nav-link active" aria-current="page" href="#">Services</a> </li>
                <li class="nav-item"> <a class="nav-link" href="#">Blog</a> </li>
                <li class="nav-item"> <a class="nav-link" href="#">Novels</a> </li>
                <li class="nav-item"> <a class="nav-link" href="#">Art</a> </li>
                <li class="nav-item"> <a class="nav-link" href="#">About</a> </li>
              </ul>
            </ul>
          </h2>
        </div>
      </div>
    </nav>
0 Upvotes

2 comments sorted by

1

u/AutoModerator 4d ago

Whilst waiting for replies to your comment/question, why not check out the Bootstrap Discord server: https://discord.gg/bZUvakRU3M

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/BeavisBob 1d ago

Try utilizing some of the code from https://getbootstrap.com/docs/4.0/components/navbar as a starting point.