title: Z-index is not working when parent on position fixed
body: <p>I'm doing a menu and i need its child to have a large z-index so that it´s on top of a modal when this is opened. it works perfectly, but when i set the menu to 'position: fixed' and open the modal, the child is kept behind the modal. Here is the code, ignore the last part of the css, which is just animations. Thanks for the help.</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-js lang-js prettyprint-override"><code>const btn = document.querySelector('.btn'),
        overlay = document.querySelector('.menu-overlay'),
        menu = document.querySelector('.responsive'),
        close = document.querySelector('.close'),
        barTop = document.querySelector('#bar-one'),
        barMiddle = document.querySelector('#bar-two'),
        barBottom = document.querySelector('#bar-three');
  
  
  btn.addEventListener('click', function(){
      overlay.classList.toggle('active');
      menu.classList.toggle('menuActive');
      barTop.classList.toggle('barTop');
      barMiddle.classList.toggle('barMiddle');
      barBottom.classList.toggle('barBottom');
  })</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  .menu-container {
    background: teal;
    padding: 10px 0;
    width: 100%;
    /* here is the issue i´m talking about */
    /* position: fixed; */
  }
  
  .menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    margin: 0 auto;
  }
  
  .menu li {
    list-style: none;
    padding: 5px;
  }
  
  .menu li a {
    font-family: sans-serif;
    text-decoration: none;
    color: #fff;
  }
  
  .btn-container {
    z-index: 10000 !important;
  }
  
  .btn {
    text-decoration: none;
    display: flex;
    width: 22px;
    height: 18px;
    margin: 0 auto;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all .3s;
  }
  
  .btn #bar-one.barTop {
    transform: translateY(8px) rotate(45deg);
  }
  .btn #bar-three.barBottom {
    transform: translateY(-8px) rotate(-45deg);
  }
  .btn #bar-two.barMiddle {
    opacity: 0;
  }
  
  .menu-overlay {
    position: fixed;
    width: 100%;
    top: 0;
    bottom: 0;
    background: rgba(0,0,0,.8);
    animation: fadeOverlay .3s linear;
    display: none;
    z-index: 99;
  }
  .menu-overlay.active {
    display: block;
  }
  
  @keyframes fadeOverlay {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 100%;
    }
  }
  
  .responsive {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: -100%;
    z-index: 100;
    transition: left .2s ease-in-out;
  }
  
  .responsive ul {
    display: flex;
    flex-direction: column;
    background: #000;
    width: 87%;
    height: 100%;
    padding: 20px;
  }
  
  .responsive ul li {
    padding: 5px;
  }
  
  .responsive ul li a {
    text-decoration: none;
    color: #fff;
  }
  
  .responsive.menuActive {
    left: 0;
  }
  
  .close {
    text-decoration: none;
    display: block;
    color: #fff;
    width: 10%;
    position: absolute;
    top: 0;
    right: 0;
    font-size: 40px;
    text-align: center;
    margin-top: 5px;
  }
  
  .close.closeActive {
    animation: fadeClose .4s linear;
  }
  
  @keyframes fadeClose {
    0%, 90% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }</code></pre>
  <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;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;Menu Celular&lt;/title&gt;
    &lt;link rel="stylesheet" href="styles.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
    &lt;div class="menu-overlay"&gt;&lt;/div&gt;
    &lt;div class="menu-container"&gt;
      &lt;ul class="menu"&gt;
        &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li class="btn-container"&gt;
          &lt;a href="#" class="btn"&gt;
            &lt;span id="bar-one"&gt;&lt;/span&gt;
            &lt;span id="bar-two"&gt;&lt;/span&gt;
            &lt;span id="bar-three"&gt;&lt;/span&gt;
          &lt;/a&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div class="responsive"&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Exit&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
  
  
  
  &lt;script src="./js.js" charset="utf-8"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>