我有 2div秒,并希望第一个定义的div(称为befront)位于紧随其后的定义的前面div(称为beback)。
使用position: absolute;会破坏设计,所以我只想使用z-index哪个不起作用。
我使用了以下 CSS,但没有运气:
#befront {
    width:100%; height:20px; background:red;
    /* I expect that the rex box be in front of the yellow box*/
    margin-bottom:-20px;
    z-index: 1000;
}
#beback {
    width:100%; height:20px; background:yellow;z-index:1;
}