firefox - 背景图像在 mozilla firefox 中不起作用

标签 firefox css

正文背景在 firefox 中不显示。

这是我的 CSS

body{
    font-family:"Trebuchet MS", Helvetica, sans-serif;
    font-size:15px;
    color: #fff;
    overflow-x:hidden;
    background: url(../images/2.jpg) no-repeat center center fixed; 
    -webkit-background-size: cover;
    -moz-background-size: cover; 
    -o-background-size: cover;
    background-size: cover; 
}

最佳答案

通常当我遇到这个问题时,错误来自图像的路径。如果我是你,我会尝试将它从你的相对路径 url('../images/yourimage.jpg') 更改为绝对路径: 前任。 url('home/user/Desktop/website/images/yourimage.jpg').

如果您的站点已链接到包含图像的文件夹(但应该如此),则您不需要这样做。你只需要 url('image/yourimage.jpg');因为您的站点已经从该文件夹中提取文件

关于firefox - 背景图像在 mozilla firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11228817/

相关文章:

html - 使用css创建线加载动画

html - html/css 中的阶梯文本

Firefox mobile (android) 和orientationchange

javascript - Firefox 在针对正则表达式编译长词时抛出过于复杂的错误

javascript - 将文件拖到 Firefox 时 dropEffect 不起作用

css - 在框中以全宽显示 Woocommerce 变体下拉列表

html - 如何摆脱 'subscribe to our newsletter' 部分上方的空白

css - 里面有元素的最后一个 child

css - Firefox Windows/Linux 不一致

javascript - EventSource 监听器不会在 Firefox 中的页面加载时触发