Note that there are some explanatory texts on larger screens.

plurals
  1. POIE 6 z-index and position: fixed; issue
    primarykey
    data
    text
    <p>Here is an issue i was trying to solve for sometime now! I looked all around for solutions, but couldnt find one. To begin with here is how my html is structured(just the skeletal framework) - </p> <pre><code>&lt;body&gt; &lt;div class="header"&gt; &lt;/div&gt; &lt;div id="content-wrapper"&gt; &lt;a href="/some.html"&gt;&lt;div class="feedback_div"&gt;&lt;/div&gt;&lt;/a&gt; &lt;/div&gt; &lt;div id="footer-wrapper"&gt;&lt;/div&gt; &lt;/body&gt; </code></pre> <p>Now my <strong>.feedback</strong> div has been <strong>positioned</strong> to <strong>fixed</strong> and given <code>top: 40%;</code> and <code>right: 0;</code> and z-index too(ofcourse). While this work fine in all browsers as usual IE 6 messes it up. So in order to replicate its effects on IE 6 i got this solution -</p> <pre><code>/* IE 6 only */ * .feedback_div { z-index: 9998; position: absolute; top: expression( (( t=document.documentElement.scrollTop) ? t: document.body.scrollTop) +'px'); right: -140px; } * #content-wrapper { position: relative; z-index: 9999; } * #footer-wrapper { z-index: 0; position: relative; } * html { overflow: auto; } * html body { height: 100%; /* required */ } /* END: IE 6 only */ </code></pre> <p>But <strong>problem</strong> now is that, while the the <strong>.feedback</strong> div follows you as you scroll, when it reaches the <strong>.footer</strong> div, the feedback div goes behind it. I tried playing around with the z-index but nothing worked.</p> <p>Now i know that the Ideal solution would be to re-structure the html such that the <strong>.feedback</strong> div is child to <code>&lt;body&gt;</code>. But i'm not looking to change the structure coz that would mean messing around in the backend. I'm looking to solve this only for ie .. so even hack of some sort would do, as long as it works as intended.</p> <p>So does any one have <strong>solution</strong> for this? Any help will be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload