Search code examples
z-order

Zorder for 3D display


I have 2 div:

<div id="one"></div>
<div id="two"></div>

Normally the 2nd is over the first. But I want the first to stay in front with zorder:

div {
    position: absolute;
    width: 100px;
    height: 100px;
}

#one {
    top: 20px;
    left: 20px;
    background: red;
    zorder: 2;
}

#two {
    top: 50px;
    left: 50px;
    background: blue;
    zorder: 1;
}

Why does this not work?


Solution

  • This is HTML and so I guess you meant z-index:

    #one {
        z-index: 2;
    }
    
    #two {
        z-index: 1;
    }