Why does z-index: -1; appear above z-index: 1;?

Viewed 8961

Explain this behavior:

<div style="z-index: 1"></div>
<div></div>
<div></div>
<div></div>
div {
   position: relative;
   background: red;
   width: 100px;
   height: 100px;    
}

div:before {
    position: absolute;
    background: blue;
    width: 100px;
    height: 100px;  
    z-index: -1;
    content: "";
    left: -5px;
    top: -5px;
}

http://jsfiddle.net/2VexH/2/

Only difference is the first div has z-index: 1 set.

1 Answers
Related