首页 > 解决方案 > 尝试使用 Z-Index 进行堆叠

问题描述

我刚刚开始一个新项目,但在使用z-indexCSS 中的函数时遇到了问题。无论我尝试什么,它都无法正常工作。我已经尝试交换两个 div 的值,z-index但它仍然无法正常工作。


#outerbox {
    position:absolute;
    height:700px;
    width:700px;
    background-color:darkgrey;
    left:570px;
    top:125px;
    z-index:1;
}

#innerbox {
    position:relative;
    height:680px;
    width:680px;
    background-color:grey;
    display:grid;
    margin: 0 auto;
    top:10px;
    z-index:0;
}

标签: css

解决方案


推荐阅读