title: Flexbox, z-index & position: static: Why isn't it working?
body: <p>According to flexbox specification:</p>
  
  <blockquote>
    <p>..4.3. Flex Item Z-Ordering ,... and <code>z-index</code> values other than
    <code>auto</code> create a stacking context even if <code>position</code> is <code>static</code>.</p>
  </blockquote>
  
  <p>So, I thought <code>z-index</code> / <code>opacity</code> is supposed to work as usual with flexbox but when I apply it to this HTML/CSS it doesn't work (my goal was to put <code>.header</code> on top of <code>.core</code> creating two layers):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code> .header {
     opacity: 0.5;
     z-index: 2;
     display: flex;
     align-items: center;
     justify-content: flex-end;
   }
   .headerLeft {
     z-index: inherit;
     background-color: blue;
     text-align: right;
     align-self: stretch;
     flex: 2 1 250px;
   }
   .headerCenter {
     z-index: inherit;
     background-color: red;
     text-align: right;
     align-self: stretch;
     flex: 1 1 175px;
   }
   .headerRight {
     z-index: inherit;
     background-color: green;
     text-align: right;
     align-self: stretch;
     flex: 1 1 100px;
   }
   .core {
     z-index: 0;
     display: flex;
     flex-flow: row wrap;
     align-items: center;
     justify-content: space-around;
   }
   .coreItem {
     align-self: stretch;
     flex: 1 1 400px;
   }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div class="header"&gt;
      &lt;div class="headerLeft"&gt;Left&lt;/div&gt;
      &lt;div class="headerCenter"&gt;Center&lt;/div&gt;
      &lt;div class="headerRight"&gt;Right&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="core"&gt;
      &lt;div class="coreItem"&gt;Core1&lt;/div&gt;
      &lt;div class="coreItem"&gt;Core2&lt;/div&gt;
      &lt;div class="coreItem"&gt;Core3&lt;/div&gt;
      &lt;div class="coreItem"&gt;Core4&lt;/div&gt;
      &lt;div class="coreItem"&gt;Core5&lt;/div&gt;
      &lt;div class="coreItem"&gt;Core6&lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I used proper prefixes on flex properties. I don't understand why it's not working.</p>