keep fixed div within its container
<p>I have a fixed positioned Div that should stop scrolling / become unfixed, so not to pass over a footer DIV. So this is not a question of using z-index to place the footer over the fixed DIV. The fixed div should stop above the footer. <a href="https://jsfiddle.net/euje2kqq/" rel="nofollow">https://jsfiddle.net/euje2kqq/</a></p>

<pre><code>#fixedDiv{
  position:fixed;
  width:100px;
  height:175px;
  margin-top:30px;
  background-color:#DB1926;
  color:white;
  padding:10px;
  display: inline-block;
  vertical-align:top;
}
</code></pre>

<p>Can anyone help or put me in the right direction. Thanks.</p>