Home > Mobile >  How to justify li objects right and left in my navbar
How to justify li objects right and left in my navbar

Time:09-12

I want to justify li objects right and left in my navbar. How can I do it?

        <nav >
            <button  type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
              <span ></span>
            </button>
            <div  id="navbarNav">
              <ul >
                <li >
                  <a  href="#">ABOUT US</a>
                </li>
                <a href="#"><img src="images/logo.png"></a>
                <li >
                  <a  href="#">CONTACT</a>
                </li>
              </ul>
            </div>
          </nav>

Image

CodePudding user response:

Do you want something like this?

.navbar-nav{
  display: flex;
  justify-content: space-around;
}
<nav >
            <button  type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
              <span ></span>
            </button>
            <div  id="navbarNav">
              <ul >
                <li >
                  <a  href="#">ABOUT US</a>
                </li>
                <a href="#"><img src="images/logo.png"></a>
                <li >
                  <a  href="#">CONTACT</a>
                </li>
              </ul>
            </div>
          </nav>

  • Related