Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么firefox不显示我的背景图像?_Html_Css_Firefox - Fatal编程技术网

Html 为什么firefox不显示我的背景图像?

Html 为什么firefox不显示我的背景图像?,html,css,firefox,Html,Css,Firefox,我有一个网站,它在chrome、edge和其他浏览器中运行良好,但当我使用Firefox时,网站的背景消失了。如果我检查CSS,只需在CSS中点击这里和那里,它就会开始出现,但如果我在没有cookies的情况下重新加载页面,它就会再次消失。 这是我的CSS .top { background-image: url("../img/img.png"); background-position: center center; background-repe

我有一个网站,它在chrome、edge和其他浏览器中运行良好,但当我使用Firefox时,网站的背景消失了。如果我检查CSS,只需在CSS中点击这里和那里,它就会开始出现,但如果我在没有cookies的情况下重新加载页面,它就会再次消失。 这是我的CSS

.top {
    background-image: url("../img/img.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    height: 100%;
}
URL很好,我已经测试过了。有人能帮我吗? 我已经试过了

display: block;

您可以使用html元素,因为它比body更适合始终至少保持浏览器窗口的高度。在其上设置固定且居中的背景

html {
     background: url('../img/img.png') no-repeat center center fixed;
     -webkit-background-size: cover;
     -moz-background-size: cover;
     -o-background-size: cover;
     background-size: cover;
}

我的建议是发布一个完整的例子来说明这个问题。例如,与哪个class.top关联可能很重要。谈论堆叠层。也许你还有别的东西使它模糊了?我已经试过了。top是一个随机div类。我在一个最小的html文档中添加了min-height:100px,但无法重现问题`.top{…min-height:100px;}。你能看到这个吗。但是不要在JSFIDLE中感到困惑。它可以正常工作,但在我的位置上不行。JSFIDLE.net不适合我。您还没有展示一个自包含的示例来说明问题。您的搜索(moz背景)与任何文档都不匹配。建议:确保所有单词拼写正确。尝试不同的关键字。试试更一般的关键词。这是我在谷歌搜索时得到的。你可以查看以下链接:搜索-moz背景剪辑,-moz背景来源,-moz背景内联策略,-moz背景大小@rabinadhikarii在那里搜索并找到-moz背景大小:封面;deleteicon已经过时了,因为Gecko 2不允许你通过浏览器使用它