📜  绝对位置上的 z-index - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:26.941000             🧑  作者: Mango

代码示例1
#relative {
    position: relative;
    width: 40px;
    height: 100px;
    background: #000;
    z-index: 1;
    margin-top: 30px;
}
.absolute {
    position: absolute;
    top: 0; left: 0;
    width: 200px;
    height: 50px;
    background: yellow;
}