title: css - Bootstrap - Vertically align form with form-control input-sm in navbar
body: <p>I can't seem to be able to vertically align a form with "input-sm" that is placed within the navbar.  If the inputs to the form are not the same height as the navbar, it appears that they get top aligned.  I was hoping there might be a way to do this without manually adjusting the padding or margin-top.  Any ideas?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Example&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&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;/head&gt;
  
  &lt;body&gt;
    &lt;header&gt;
      &lt;div class="navbar navbar-default navbar-fixed-top" role="navigation"&gt;
        &lt;div class="container"&gt;
          &lt;div class="navbar-header"&gt;
            &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt;
            &lt;button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main"&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" id="navbar-main"&gt;
            &lt;ul class="nav navbar-nav"&gt;
              &lt;li class="active"&gt;
                &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-home"&gt;&lt;/span&gt; Home&lt;/a&gt;
              &lt;/li&gt;
              &lt;li&gt;
                &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-info-sign"&gt;&lt;/span&gt; About&lt;/a&gt;
              &lt;/li&gt;
              &lt;li&gt;
                &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-envelope"&gt;&lt;/span&gt; Contact&lt;/a&gt;
              &lt;/li&gt;
            &lt;/ul&gt;
            &lt;form class="navbar-form navbar-right" role="search"&gt;
              &lt;div class="form-group"&gt;
                &lt;input type="email" class="form-control input-sm" name="email" placeholder="Email"&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;input type="password" class="form-control input-sm" name="password" placeholder="Password"&gt;
              &lt;/div&gt;
              &lt;button type="submit" class="btn btn-primary btn-sm"&gt;Sign In&lt;/button&gt;
            &lt;/form&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/header&gt;
    &lt;script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"&gt;&lt;/script&gt;
    &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/xsaLt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xsaLt.png" alt="enter image description here"></a>
  It doesn't look too bad as is, I just want to figure out how to do it!</p>