我目前正在尝试使用z-index以特定顺序定位某些DIV,但他们似乎并没有预先设置好,请在jsfiddle中设置它以供您查看如果你能看到任何问题。使用z-index定位DIV
这是我想它是从后到前的顺序:
RED 绿色 BLUE 黄色
HTML
<div id="green">
<div id="yellow">
</div>
<div id="red">
</div>
</div>
<div id="blue">
</div>
C SS
#green{
background-color:green;
height:100px;
width:100%;
position:fixed;
top:0;
}
#red {
margin:-85px auto 0;
width:406px;
height:60px;
background-color:red;
z-index:-99999;
}
#blue{
margin:350px auto 0;
width:60px;
height:465px;
z-index:99999;
background-color:blue;
}
#yellow {
margin:0px auto 0;
width:170px;
height:170px;
background-color:yellow;
z-index:99999;
}
你的小提琴是不是所有你所拥有的在这里。 ??? – thatidiotguy
我认为你发布了错误的小提琴,如果你可以把代码放在那里,我相信更多的人会愿意玩它。 – Jason
http://jsfiddle.net/dKqSS/ – Madbreaks