title: Vertically align contents of div
body: <p>I'd like to vertically align the contents of my <code>div</code>.</p>
  
  <p>So basically 'Hello test' should be in the center of the <code>div</code>, vertically.</p>
  
  <p><a href="http://jsfiddle.net/z9zw0u9g/" rel="nofollow noreferrer">Demonstration</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.parent {
      background:blue;
      float:left;
      width:100%
  }
  
  .parent div {
      float:left;
      width:50%;
  }
  
  h1 {
      font-size:50px;
      margin:0;
      padding:0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
  
  &lt;div&gt;
      &lt;h1&gt;hello!&lt;/h1&gt;
      &lt;p&gt;test&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;img src="http://placehold.it/250x250" /&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>