title: How can I align a bootstrap navbar brand vertically?
body: <p>The brand is centered until i change it to an img.</p>
  
  <p>I have tried many different ways of fixing it in css, but it wont work.</p>
  
  <p>How can i vertically align this logo? and why doesnt my css work? For some reason, not all of my css styles are being applied.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;title&gt;Stuff&lt;/title&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
  &lt;link rel="stylesheet" type="text/css" href="app.css" &gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;nav class="navbar navbar-default"&gt;
  
  
  &lt;div class="container-fluid"&gt;
  &lt;div class="navbar-header"&gt;
  &lt;a class="navbar-brand" href="index.html"&gt;
  &lt;img id="logo" alt="Brand" src="images/logo.jpg" width="40px" height="40px"&gt;
  &lt;/a&gt;
  &lt;/div&gt;
  &lt;div&gt;
  
  
  &lt;div class="container" id="mynav"&gt;
      &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
      &lt;div class="navbar-header"&gt;
        &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"&gt;
          &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&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;!-- Collect the nav links, forms, and other content for toggling --&gt;
      &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
        &lt;ul class="nav navbar-nav"&gt;
          &lt;li class="active"&gt;&lt;a href="#"&gt;Link &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
  
        &lt;/ul&gt;
  
        &lt;ul class="nav navbar-nav navbar-right"&gt;
          &lt;li&gt;&lt;a href="#"&gt;Login&lt;/a&gt;&lt;/li&gt;
  
        &lt;/ul&gt;
      &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
    &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
  &lt;/nav&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>css:</p>
  
  <pre><code>#mynav
  {
      width: 80%;
  }
  
  #logo
  {
      width:50px;
      height: 50px;
      vertical-align: middle;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/BCryx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BCryx.png" alt="Here is a picture of the problem"></a></p>