title: How to vertically top align a <nav> inside a <div>?
body: <p>I want to align my <code>&lt;nav&gt;</code> tag to the top of my <code>&lt;div&gt;</code> tag but it's not happening. I tried configuring the top property but that is not responsive. Please suggest how should I vertically top align the navbar so that it's also responsive.</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-css lang-css prettyprint-override"><code>.vertical-align-helper {
    height: 100vh;
  }
  
  .vertical-align-helper:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-left: -5px;
  }
  
  .vertical-align-helper&gt;[class*=vertical-align-] {
    display: inline-block;
    width: 100%
  }
  
  .vertical-align-middle {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .site-wrapper {
    position: relative;
    top: 0;
    width: 100%;
    overflow: hidden
  }
  
  .block {
    position: relative
  }
  
  .block.hero {
    background-position: center center;
    background-repeat: no-repeat;
    position: fixed;
    height: 100%;
    width: 100%;
    z-index: 300;
    overflow: hidden
  }
  
  .block.hero .block__content {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    user-select: none;
    cursor: default;
  }
  
  .block.hero .preloader {
    position: absolute;
    left: 50%;
    margin-left: -32px;
    bottom: 64px;
    -webkit-transition: .5s cubic-bezier(.6, -.28, .735, .045);
    -moz-transition: .5s cubic-bezier(.6, -.28, .735, .045);
    transition: .5s cubic-bezier(.6, -.28, .735, .045)
  }
  
  .preloader img {
    height: 64px;
    border-radius: 64px;
  }
  
  .block.hero .main-nav {
    bottom: -64px;
    -webkit-transition: .4s cubic-bezier(.165, .84, .44, 1) .5s;
    -moz-transition: .4s cubic-bezier(.165, .84, .44, 1) .5s;
    transition: .4s cubic-bezier(.165, .84, .44, 1) .5s;
  }
  
  .loaded .block.hero {
    position: relative
  }
  
  .loaded .block.hero .preloader {
    bottom: -200px
  }
  
  .loaded .block.hero .main-nav {
    bottom: 0
  }
  
  .block {
    min-height: 100vh;
  }
  
  .block.hero {
    background: #212121;
    color: #fff;
    height: 100vh;
  }
  
  .block.hero .name {
    font-family: 'Expletus Sans', cursive;
    font-size: 8vw;
    font-weight: 100;
    margin: 0;
    line-height: 0.8em;
  }
  
  .block.hero .name span {
    font-weight: 600;
  }
  
  .block.hero .subtitle {
    font-family: 'Titillium Web', sans-serif;
    margin: 0;
    text-transform: uppercase;
    font-size: 2vw;
    font-weight: 100;
    margin-top: 26px;
    /*    margin-bottom: 26px;*/
  }
  
  .nav {
    padding: 1vh 2vw;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    text-align: center;
  }
  
  .nav a {
    text-decoration: none;
    margin-right: 15px;
    color: #fff;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 500;
    font-size: 20px;
    text-align: center;
    vertical-align: middle;
    position: relative;
    bottom: 10vh;
  }
  
  .nav a:nth-of-type(2) {
    /*    left: 85vw;*/
    text-align: right;
  }
  
  .nav a:focus,
  .nav a:visited {
    text-decoration: none;
    color: #fff;
  }
  
  .block__content img {
    position: relative;
    top: 28vh;
  }
  
  h1.section-title {
    color: #b61e56;
    font-weight: 300;
    font-size: 1.7vw;
    margin-top: 0;
    font-family: 'Roboto Condensed', sans-serif;
  }
  
  .hamburger-icon {
    margin: 0;
    padding: 18px;
    height: 57px;
    width: 100vw;
    position: relative;
    top: -100.5vh;
    background-color: rgba(50, 50, 50, 0.7);
  }
  
  .hamburger-icon .burger {
    margin-bottom: 5px;
    background-color: #ffffee;
    height: 2px;
    width: 30px;
    border-radius: 3px;
  }
  
  .hamburger-icon .burger:last-child {
    margin-bottom: 0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="site-wrapper"&gt;
    &lt;div class="site-main fullpage"&gt;
      &lt;section data-id="hero" class="block hero" style="margin-top:0;padding:0"&gt;
        &lt;canvas class="hero__canvas" id="canvas__particles" data-bg-color="#232323"&gt;&lt;/canvas&gt;
        &lt;nav class="hamburger-icon"&gt;
          &lt;div class="burger"&gt;&lt;/div&gt;
          &lt;div class="burger"&gt;&lt;/div&gt;
          &lt;div class="burger" style="margin-bottom: 0;"&gt;&lt;/div&gt;
        &lt;/nav&gt;
        &lt;div class="block__content vertical-align-helper"&gt;
          &lt;div class="vertical-align-middle"&gt;
            &lt;h1 class="name"&gt;Chirag &lt;span&gt;Bhansali&lt;/span&gt;&lt;/h1&gt;
            &lt;h3 class="subtitle"&gt;Front-End Web Developer&lt;/h3&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Note: I have already <a href="https://stackoverflow.com/questions/26632188/how-to-vertically-top-align-div-inside-of-div">this</a> thread but that did not solve my problem.</p>