title: Center nav-bar (ASP.NET MVC)
body: <p>I have a navbar, and the elements need to be centered within the navbar. I have attempted to do this with margin, however, it is not working. Any suggestions on how I can achieve this with CSS?</p>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;div class="navbar "&gt;
      &lt;div class="container" style="margin-left: 160px;"&gt;
          &lt;div class="navbar-header"&gt;
              &lt;button type="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;!--@Html.ActionLink("Видео Интрервью", "Index", "Home", new {area = ""}, new {@class = "navbar-brand"})--&gt;
          &lt;/div&gt;
          &lt;div class="navbar-collapse collapse"&gt;
              &lt;ul class="nav navbar-nav"&gt;
                  &lt;li&gt;@Html.ActionLink("Компании", "Index", "Companies")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Подтвержденные", "Approved", "Interwier")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Приглашения", "Individual", "InvitationMails")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Создать интервью", "WelcomeScreen", "Questions")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Просмотр", "Viewing", "Interwier")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Входящие", "Incoming", "Interwier")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Архив", "Archive", "Interwier")&lt;/li&gt;
              &lt;/ul&gt;
              @Html.Partial("_LoginPartial2")
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>These are the CSS classes:</p>
  
  <pre><code>.navbar-nav {
      float:none;
      margin: 0 auto;
      display: table;
      table-layout: fixed;
  }
  
  .navbar-nav &gt; li &gt; a {
      padding-top: 10px;
      padding-bottom: 10px;
      line-height: 20px;
      color: #000000;
      font-size: 18px;
  }
  </code></pre>