Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS z-index overridden by element order on page?
    primarykey
    data
    text
    <p>I've been battling with CSS z-index in IE7 foe a couple of hours now, maybe you can help!</p> <p>I have a absolutely positioned div, appearing above its parent div, which is great. But - it appears under later divs that are siblings to its parent.</p> <p>That seems like quite bizarre behavour, like the z-index only applies to the local scope of each div or something.</p> <p>How can I set things up so that when I set an element to have a greater z-index than any other element on the page, it will appear on top regardless?</p> <p>Here's my test page:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div style="position: relative; z-index: 0"&gt; div1 &lt;div style="position: relative; z-index: 0"&gt; div2 &lt;/div&gt; &lt;div style="color: red; background-color: #ffffff; position: absolute; z-index: 2"&gt; div3 &lt;/div&gt; &lt;/div&gt; &lt;div style="position: relative; z-index: 0"&gt; div1 &lt;div style="position: relative; z-index: 0"&gt; div2 &lt;/div&gt; &lt;div style="color: red; background-color: #ffffff; position: absolute; z-index: 2"&gt; div3 &lt;/div&gt; &lt;/div&gt; &lt;div style="position: relative; z-index: 0"&gt; div1 &lt;div style="position: relative; z-index: 0"&gt; div2 &lt;/div&gt; &lt;div style="color: red; background-color: #ffffff; position: absolute; z-index: 2"&gt; div3 &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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.
 

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