我有以下 CSS:
#header-fixed {
background: url(images/header-fixed-bg.png) repeat-x 0 0;
border-bottom: 1px solid #111;
position: fixed;
top: -70px;
width: 100%;
z-index: 1000;
-webkit-box-shadow: rgba(0,0,0,0.3) 0 0 4px;
-moz-box-shadow: rgba(0,0,0,0.3) 0 0 4px;
box-shadow: rgba(0,0,0,0.3) 0 0 4px;
}
.large-bg-1 {
background: url(images/large-bg-1.jpg) repeat 0 0;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-attachment: fixed;
background-position: 50% 0;
position: relative;
height: 294px;
width: 100%;
}
我正在使用视差背景技术(当背景看起来比页面的其余部分滚动得慢时)。但无论我向固定菜单添加多少 z-index
,它们仍然会隐藏它。
我该如何解决这个问题?
最佳答案
设置其他元素的z-index
为-1
关于html - 固定菜单被相对定位的图像隐藏了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18649972/