Home > Enterprise >  My navbar is not moving to the right with mr-auto?
My navbar is not moving to the right with mr-auto?

Time:01-29

I use mr-auto to try and move the navbar to the right but its not working. I'm not sure why. Can anyone explain. Here is my code:

<nav >
            <div >
              <a  href="#"><img src="/img/logo.png" alt="logo"></a>
              <button  type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span ></span>
              </button>
              <div  id="navbarNav">
                <div ></div>
                <ul >
                  <li >
                    <a  aria-current="page" href="#">Home</a>
                  </li>
                  <li >
                    <a  href="#">About Me</a>
                  </li>
                  <li >
                    <a  href="#">Projects</a>
                  </li>
                  <li >
                    <a  href="#">Skills</a>
                  </li>
                  <li >
                    <a  href="#">Contigency Plans</a>
                  </li>

CodePudding user response:

Shouldn’t your mr-auto be a part of the <ul class=“navbar-nav”>? Such as <ul class=“navbar-nav mr-auto”>.

CodePudding user response:

try this

#navbarNav{
      text-align: right;
    }

and also instead of this

<div id="navbarNav"> use this 

<div  id="navbarNav">
  •  Tags:  
  • Related