gpt4 book ai didi

javascript - Cross Slide z-index 问题

转载 作者:太空宇宙 更新时间:2023-11-04 16:14:21 25 4
gpt4 key购买 nike

我正在使用 cross slide脚本。

问题是我无法将 div 移动到背景:幻灯片与所有其他 div 重叠。尝试更改 z-index:将 z-index 0 设置为背景 div,将 z-index:2 设置为所有其他 div。仍然没有成功。有没有办法将幻灯片应用到背景 div?

我的 CSS 结构看起来像这样

<body>
<div id="bg">
"all stuff goes here"
</div
</body>

#bg 的 CSS

#bg {
/* Stretch background */
position:fixed;
top:0;
left:0;
height:100%;
width:100%;
z-index:0;
}

最佳答案

将 css 设置为:

#bg {
/* Stretch background */
position:fixed;
top:0;
left:0;
height:100%;
width:100%;
z-index:0;
}

#test {
position: relative;
background-color: red;
z-index:5;
width: 120px;
margin-top:5px;
}

和 html 到:

<body>
<div id="bg"></div>
<div id="test">"all stuff goes here"</div>
</body>

另见我的 jsfiddle .

关于javascript - Cross Slide z-index 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7816963/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com