Zorder用于3D显示

时间:2013-04-21 23:14:15

标签: z-order

我有2 div

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

通常第二个超过第一个。但我希望第一个留在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;
}

为什么这不起作用?

1 个答案:

答案 0 :(得分:0)

这是HTML,所以我想你的意思是z-index

#one {
    z-index: 2;
}

#two {
    z-index: 1;
}