title: Z-index doesn't work with flex elements?
body: <p>I'm trying to have two columns, one being a menu which can expand and overlap the other column. But I used a flex element to wrap these columns and my menu expands <strong>behind</strong> the other element, even with a greater <code>z-index</code>.</p>
  
  <p>The render is something like this:</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>.main {
    font-family: 'Open Sans', Helvetica, sans-serif;
    display: flex;
    background-color: #99baef;
  }
  
  nav {
    height: 100%;
    width: 8em;
    background-color: black;
    z-index: 1;
  }
  
  .navbox {
    box-sizing: border-box;
    background-color: black;
    color: white;
    height: 4em;
    width: 100%;
    text-align: center;
    line-height: 4em;
    border-top: 1px dotted #99baef;
    transition: all 1s;
  }
  
  .navbox:hover {
    width: 130%;
    border-top: none;
    background-color: #4a77c4;
    color: black;
  }
  
  .container {
    padding: 1em;
  }
  
  a {text-decoration: inherit;}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="main"&gt;
    &lt;div class="maincolumn"&gt;
      &lt;nav&gt;
        &lt;a href=""&gt;
          &lt;div class="navbox"&gt;
            Nav 1
          &lt;/div&gt;
        &lt;/a&gt;
        &lt;a href=""&gt;
          &lt;div class="navbox"&gt;
            Nav 2
          &lt;/div&gt;
        &lt;/a&gt;
      &lt;/nav&gt;
    &lt;/div&gt;
    &lt;div class="maincolumn"&gt;
      &lt;div class="container"&gt;
        &lt;h2&gt;Title&lt;/h2&gt;
        &lt;p&gt;This is a text.&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>See? I want my menu to overlap the rest of my page when expanding. How can I do that?</p>