0

在查看了一些与 z-index 相关的帖子和​​内容背后显示的菜单后,我找不到它仍然对我不起作用的原因。

基本上,当我们滚动时,菜单会固定在顶部,但不会显示在 我正在使用的这个画廊http://tympanus.net/Development/AutomaticImageMontage/index.html上。但是,它可以正常与其他内容一起使用,如下例所示。

这里的例子http://www.dwuser.com/education/content/creating-a-floating-navigation-menu/demo/complete.html

请问有什么帮助吗?

4

1 回答 1

1

如果它是您所指的标题,请设置更高的z-indexposition: fixed。您还需要设置width: 100%;参见下面的示例

.header {
height: 25px;
line-height: 24px;
font-size: 13px;
background: #000;
opacity: 0.9;
text-transform: uppercase;
z-index: 1000;
position: fixed;
width: 100%;
}

已编辑

nav {
position: fixed;
top: 0px;
background-color: rgba(0, 0, 0, 0.882353);
left: 0px;
width: 950px;
z-index: 1000;
background-position: initial initial;
background-repeat: initial initial;
}
于 2013-08-04T18:08:04.410 回答