title: Center contents of NavBar - BootStrap
body: <p>I am trying to center the contents of the Nav Bar however, I cannot get it work properly</p>
  
  <p>I think everything seems to be more left aligned than center but i havent used float:left anywhere</p>
  
  <p>I am trying to Center the <strong>Image and Navigation</strong></p>
  
  <p>Code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Soni's Computer Repair&lt;/title&gt;
          &lt;meta name="viewport" content="width=device-width, inital-scale=1.0"&gt;
          &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
          &lt;link href="css/styles.css" rel="stylesheet"&gt;
  
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
  
          &lt;script src="js/bootstrap.js"&gt;&lt;/script&gt;
  
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div class="navbar navbar-inverse navbar-static-top"&gt;
  
              &lt;div class="container"&gt;
                  &lt;a class="navbar-brand"&gt;&lt;img src="Final.png"/&gt;&lt;/a&gt;
  
                  &lt;div class="navbar-header"&gt;
                      &lt;button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt;
                          &lt;span class="icon-bar"&gt;&lt;/span&gt;
                          &lt;span class="icon-bar"&gt;&lt;/span&gt;
                          &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;/button&gt;
                  &lt;/div&gt;
  
  
                  &lt;div class="navbar-collapse collapse"&gt;
                      &lt;ul class="nav navbar-nav"&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Services&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;footer class="footer"&gt;
              &lt;div class="container"&gt;
                  &lt;h6 class="text-center"&gt;Copyright &amp;copy; Soni Computer Repairs&lt;/h6&gt;
                  &lt;p class="text-center"&gt;www.SoniRepairs.com&lt;/p&gt;
              &lt;/div&gt;
          &lt;/footer&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>CSS: This is the CSS code</p>
  
  <pre><code>.nav, .navbar-nav {
      text-align: center;
  }
  
  .container img {
      height:100%;
      display: block;
      margin-right: auto;
      margin-left: auto;
  }
  
  .footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    background-color: #f5f5f5;
  }
  
  @media screen and (max-width: 500px) {
  
      .navbar-nav, .container img{
          margin-left: auto;
          margin-right: auto;
          display: table;
          table-layout: fixed;
          float:none;
      }
  
      .navbar-brand {
          position: absolute;
          width: 100%;
          left: 0;
          text-align: center;
          margin: auto;
      }
  }
  </code></pre>