html - 无法重叠 DIV

标签 html css

我在让轮播中的图像与另一个 div 重叠时遇到了一个小问题。 click here

如果您单击红色选项卡,我会尝试将瓶子的图像放在白色框 (#section1) 的顶部。我注意到当我从 .rslides 中删除 position:relative 时,旋转木马图像执行我想要它执行的操作,但是我放置在 #rslides1 中的背景图像 走在前面...

我已经调整了 z-index 属性,但是我仍然无法实现它。有没有人能解决这个问题?

最佳答案

当我将我的 css 属性更改为以下时,它起作用了:

#header{
    max-width: 1018px;
    min-width: 320px;
    width: 100%;
    margin: 0 auto;
    z-index: 10;
    position: relative;
} 

.rslides {
    list-style: none;
    overflow: hidden;
    width: 100%;
    padding: 0;
    margin-top: -275px;
    float: left;
    z-index: -1;
 }

.rslides_tabs { 
    margin: 93px auto 0; 
    position: relative; 
    width: 100%; 
    max-width: 1011px; 
    z-index: 10;
 }

关于html - 无法重叠 DIV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12183023/

相关文章:

javascript - 从文本输入中突出显示 div 中的所有匹配词

javascript:遍历表格中的所有单元格

html - css中的笔荧光笔效果

css - 使 flex 元素拉伸(stretch)全高并垂直居中其内容

php - 在 html 标签中的鼠标悬停中的 setTimeOut 函数中使用 php 变量

指定字体时 HTML 输入框对于数据来说太宽

html - 响应式设计/视口(viewport)

html - 将 Bootstrap 列高度设置为与宽度相同

html - Tumblr:询问和自定义页面

html - 靠近内联元素时图标改变宽度