Bootstrap navbar center

Bootstrap navbar center
0

#1
<!DOCTYPE html>
<html>
<head>
	<title>Personel Peortfolio</title>
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="style.css">
	<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
</head>
  <body>

    <div class="container-fluid" id="banner">
      <div class='container text-center' >
        <h1 class="display-2">AIRAS YAQUB</h1>
        <p>Programmer • Designer • Engineer</p>
        <a href="#" class="btn btn-outline-secondary btn-lg" role="button" aria-disabled="true">Learn More</a>
        
      </div>
    </div>

    <div class="navigation">
      <nav class="navbar navbar-expand-md navbar-light bg-inverse">
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav ml-auto">
            <li class="nav-item">
              <a class="nav-link" href="#">ABOUT</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">PORTFOLIO</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">CONTACT</a>
            </li>
          </ul>
        </div>
      </nav>
    </div>




  </body>

  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>



</html>

Hey guys I am trying to center my links of navbar equally. I tried everything I could and now its turning to frustration

I also used the code given below from stackoverflow but when I try to use display: inline-block it just make links line-by-line making situation worse. Could’nt understand that too

navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
}

.navbar .navbar-collapse {
text-align: center;
}
`
Kindly help me out with the problem. Help will be highly appreciated.


#2

Hi there,

just use a margin:auto

<style>
     .custom-center {
                margin: auto;
            }
</style>

  <ul class="navbar-nav text ml-auto custom-center">
            <li class="nav-item">
              <a class="nav-link" href="#">ABOUT</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">PORTFOLIO</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">CONTACT</a>
            </li>
          </ul>

Greetings