I'm trying to put a fixed
element within another fixed
element like this
<div class="wrapper-fixed">
<div class="content">
<div class="element-fixed">
<p>I'm fixed in Chrome, FF</p>
<p>Why not in IE ?</p>
</div>
</div>
</div>
When I scroll the page in Chrome and FF element-fixed
stay fixed
but in IE it scrolls too and I guess that should not happen because a fixed
element is outside the document flow.
I tried pulling it out of the content
but did not work, pulling it out of wrapper-fixed
it does but in my case I can't.
HERE A JSFIDDLE similar to my real situation
So why that happens and how fix it without pulling it out of wrapper-fixed
Adding images to illustrate the problem:
Option 1
Change your wrapper position to absolute
Fiddle - http://jsfiddle.net/za4hdmpf/
Option 2
Won't be suitable as this requires a solution that does not involve pulling element-fixed out of wrapper-fixed.
Change your markup and make position adjustments to your element-fixedCSS
Fiddle - http://jsfiddle.net/vuykwu76/