如何将字幕div放在另一个非字幕div的后面?

布兰登·杰克·苏拉诺(Brandon Jake Sullano)

我正在尝试使用内部选框使div放在没有选框的div后面

我无法将选取框div放在sphere div的后面,如何使用CSS呢?我已经把z-index:-9999; 在移动的div中,但似乎不起作用

这是我的代码

的HTML

<body>
    <div id="container" >
        <div id="sphere" >
            <marquee>
            <div id="moving">

            </div>
            </marquee>
        </div>
    </div
</body>

的CSS

#container{
    width:200px;
    height:100px;
    background-color:#000;

}
#sphere{
    width:100px;
    height:100px;
    border-radius:50px;
    background-color:#fff;
    opacity:0.6; // i reduce the opacity of the sphere so I can see the moving div at the back
    margin:auto;
    z-index:99999;
}
#moving{
    width:50px;
    height:50px;
    background-color:green;
    margin-top:25px;
    z-index:-999999;
}

为了使事情变得清晰,下图显示了我想做的事 在此处输入图片说明

基本上我只想将移动div放在球体的后面

提前致谢

格鲁普

添加overflow: hidden;#sphere

#sphere {
    width: 100px;
    height: 100px;
    border-radius: 50px;
    background-color: #fff;
    opacity:0.6;
    overflow: hidden;
    margin: auto;
    z-index:99999;
}

CSS:溢出

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章