title: Logout form within Bootstrap navbar dropdown
body: <p>I have a Bootstrap3 navbar with a dropdown menu.</p>
  
  <p>I want my "logout" form inside that dropdown. It is not a visible form, just a logout button within a form.</p>
  
  <p>I tried this:</p>
  
  <pre><code>&lt;div class="navbar-collapse collapse"&gt;
    &lt;ul class="nav navbar-nav"&gt;
      &lt;li class="dropdown"&gt;
        &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"&gt;Dropdown&lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;ul class="dropdown-menu"&gt;
  
          &lt;!-- this dropdown menu item looks right --&gt;
          &lt;li&gt;&lt;a href="#"&gt;Foo&lt;/a&gt;&lt;/li&gt;
  
          &lt;!-- this dropdown menu item (a logout form) does not --&gt;
          &lt;li&gt;&lt;form action="/logout" method="post"&gt;&lt;button type="submit" class="btn btn-link navbar-btn navbar-link"&gt;Log off&lt;/button&gt;&lt;/form&gt;&lt;/li&gt;
  
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But it is not styled properly.</p>
  
  <p>How do I make it match normal dropdown links? I hope I don't need to manually tweak the css, and that there's a built in way to do this?</p>