Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with z-index
    primarykey
    data
    text
    <p>I know there are a lot of questions on z-index around here, but I am using z-index for a while now and it always worked fine, but now I'm struggling on this one and I just don't understand why it isn't working because I think I did all necessary steps.</p> <p><em>test.html</em></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta content="text/html;charset=utf-8" http-equiv="Content-Type"&gt; &lt;meta content="utf-8" http-equiv="encoding"&gt; &lt;link href="style.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js " type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('.boxGrid').hover(function(){ $(".boxCaption", this).stop().animate({bottom:'0px'},{queue:false,duration:300}); }, function() { $(".boxCaption", this).stop().animate({bottom:'-121px'},{queue:false,duration:300}); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div style="position: relative; width: 226px; height: 246px;"&gt; &lt;div class="boxGrid"&gt; &lt;div class="buttonBack blogImg"&gt; &lt;div class="boxCaption"&gt; &lt;h3&gt;Top-Blog&lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><em>style.css</em></p> <pre><code>.boxGrid { width: 226px; height: 246px; background-image: url(buttonBorder.png); position: absolute; top: 0px; left: 0px; z-index: 100; } .buttonBack { position: absolute; top: 12px; left: 13px; border: 0px; width: 200px; height: 223px; z-index: 50; overflow: hidden; } .blogImg { background-image: url(blogButton.png); } .boxCaption { position: absolute; background: url(caption.png); height: 121px; width: 100%; bottom: -121px; text-align: center; } .boxCaption h3 { font-size: 30px; color: #fff; } </code></pre> <p>So I want this <code>.boxGrid</code> class to be above the <code>.buttonBack</code> class, I added <code>position:</code> properties to all div's that are using z-index.</p> <p><a href="http://jsfiddle.net/xU8hG/" rel="nofollow">JsFiddle</a> so the red box needs to be behind the blue one.</p> <p>Thanks in advance</p>
    singulars
    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.
 

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