title: HTML Position image behind border and wrapping link above
body: <p>I have a content div with a ragged border (using a border-image) and I place another div each below the content div left and right to hold an image. This image is supposed to have a link. While the image shows nicely through the border the link area gets hidden by it. Given that my ragged border is rather wide (almost 100px), this feels quite confusing. Therefore I would like to "float" the image below the border and the actual link area above so that the link is clickable as well were the image is under the border or visible through the border.</p>
  
  <p>Despite not having the background-image uploaded the effect becomes visible since the border is wide black. The structure includes a minimal header, which is not vital to the problem but is part of the root structure.</p>
  
  <p>Another problem is that the link area expands to more than the wrapped image in height, however this is a minor issue.</p>
  
  <p><a href="http://jsfiddle.net/hc3jrkku/" rel="nofollow">http://jsfiddle.net/hc3jrkku/</a></p>
  
  <p>Basestructure:
  </p>
  
  <pre><code>&lt;header&gt;
      &lt;nav&gt;
          &lt;a href='?p=faq#faq' id='faq'&gt;
              FAQ
          &lt;/a&gt;
      &lt;/nav&gt;
  &lt;/header&gt;
  &lt;div class='leftSide'&gt;
      &lt;a href="#anchor" class="bgImage"&gt;&lt;img src="img/some.png" style="
      position: relative;
      z-index: -1;
      opacity: .99;
      border: 1px solid red;
      width: 150px;
      height: 200px;
      background-color: red,
  "&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class='rightSide'&gt;{$right}&lt;/div&gt;
  &lt;main&gt;
  &lt;div class='container'&gt;
  {$content}
  &lt;/div&gt;
  &lt;/main&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>* {
      box-sizing: border-box
  }
  
  body {
      margin: 0;
  }
  
  .leftSide{
      position: fixed;
      z-index: 0;
      top: 20px;
      right: 50%;
      transform: translateX(-50%);
      width: 808px;
      height: 100%;
      display: flex;
      justify-content: flex-end; 
      margin-right:-93px;
      padding: 15px 93px 90px 0;
  }
  
  .rightSide{
      position: fixed;
      z-index: 0;
      top: 20px;
      left: 50%;
      transform: translateX(50%);
      width: 808px;
      height: 100%;
      margin-left:-93px;
      padding: 15px 0 90px 93px;
  }
  
  a.bgImage {
      z-index:900;
      opacity:.99;
      border:2px dashed blue
  }
  
  .rightSide .bgImage {
  margin-left: -93px;
  }
  
  .leftSide .bgImage {
  margin-right: -93px;
  }
  
  main {
      width: 808px;
      min-height: 400px;
      margin: 20px auto 0;
      position: relative;
      z-index: 50;
      border-style: solid;
      border-width: 0px 93px 127px 93px;
      border-image: url(img/paperedge.png) 0 93 127 93 fill round;
      padding-top:10px;
  }
  
  header {
      height: 20px;
      background: #ffffff url(img/header_bg.png) repeat-x bottom;
      border-bottom: 1px solid #000000;
      position: fixed;
      width: 100%;
      top: 0;
      z-index: 100
  }
  
  nav {
      display: flex;
      justify-content: center;
  }
  </code></pre>
  
  <p>Having read <a href="http://philipwalton.com/articles/what-no-one-told-you-about-z-index/" rel="nofollow">http://philipwalton.com/articles/what-no-one-told-you-about-z-index/</a>, I tried creating new context(s) as well, and stripping the divs containing left/right background image of the z-index, However my current code depends on the <code>transform</code>/<code>position</code> thus creating a new context for the parent element either way. Is the sandwich stacking (some children above other parts of the page/others below) possible anyways?</p>