Html 固定背景的Div部分在Firefox中不显示

Html 固定背景的Div部分在Firefox中不显示,html,css,firefox,Html,Css,Firefox,这个具有固定背景的div在Safari和Chrome中都显示良好,但在Firefox中则没有。我试图找出原因,但运气不佳。 谢谢你的建议 HTML <div class="fixed-section fixed-bg-1"> <div class="overlay"></div> </div> 覆盖中有2个z索引属性。不止一个Safari/Chrome/Firefox以不同的顺序阅读它们 例如: Safari/Chrome-z-index:0

这个具有固定背景的div在Safari和Chrome中都显示良好,但在Firefox中则没有。我试图找出原因,但运气不佳。 谢谢你的建议

HTML

<div class="fixed-section fixed-bg-1">
  <div class="overlay"></div>
</div>

覆盖中有2个z索引属性。不止一个Safari/Chrome/Firefox以不同的顺序阅读它们

例如: Safari/Chrome-z-index:0然后z-index:3
Firefox-z-index:3,然后z-index:0

添加一个
高度:50%到固定截面类以及最小高度,如下所示:

.fixed-section {
    height: 50%;
    min-height: 50%;
    background-attachment: fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
}

你有没有链接到上面代码的演示站点??如果没有,你能在JSFIDDLE网站上提供上述信息吗?你有证据证明这是真的吗?@Paulie_知道的最好办法,我想,就是删除一个,看看它是否解决了这个问题。如果是这样的话,我们就可以疯狂地测试所有的可能性,看看哪些浏览器做了什么。属性是按给定的顺序解析的……多年来一直如此。如果3在0之后,则3适用。很抱歉,复制粘贴会添加另一个z索引。我试图删除z-index属性和overlay类,但没有做什么。在firefox中,div不会出现
.fixed-section {
    height: 50%;
    min-height: 50%;
    background-attachment: fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
}