CSS - 背景大小:盖;在Firefox中不工作 [英] CSS - background-size: cover; not working in Firefox

查看:241
本文介绍了CSS - 背景大小:盖;在Firefox中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

body{
    background-image: url("./content/site_data/bg.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    font-family: 'Lobster', cursive;
}

检查: http://demo.jayantbhawal.in 的Firefox浏览器,而不是在宽屏模式

Check: http://demo.jayantbhawal.in on firefox browsers, NOT in widescreen mode.

在code适用于Chrome(Android版+ PC),甚至股票Android浏览器,而在Firefox(的Andr​​oid + PC)。是否有良好的替代品呢?为什么不工作反正? Google搜索这个问题很多次,但没有其他人似乎有这个问题。难道仅仅是我吗?在任何情况下,如何解决呢?
有相当一些关于它的SO问题太多,但他们没有提供合法的解决方案,因此能有人告诉我,如果他们有后台尺寸:盖;在Firefox的问题吗?

The code works on Chrome(Android + PC) and even the stock Android browser, but NOT Firefox(Android + PC). Is there any good alternative to it? Why is it not working anyways? Googled this issue a lot of times, but no one else seems to have this problem. Is it just me? In any case, how do I fix it? There are quite some questions on SO about it too, but none of them provide a legitimate solution, so can someone just tell me if they have background-size: cover; issues on firefox too?

所以基本上告诉我三件事情:
1.为什么会发生?
2.什么是一个很好的选择呢?
3.这是发生在你身上?在课程的Firefox浏览器。

So basically tell me 3 things: 1. Why is it happening? 2. What is a good alternative to it? 3. Is this happening to you too? On Firefox browsers of course.

Chrome版本35.0.1916.114米
火狐版本29.0.1

Chrome Version 35.0.1916.114 m Firefox Version 29.0.1

请注意:我可能已经尝试修复,因此,有时您可能会看到一个完全怪异的一页。稍等一下,并重新加载。

Note: I may already be trying to fix it so at times you may see a totally weird page. Wait a bit and reload.

推荐答案

好了,它看起来好吧我在最新的Mozilla浏览器。

Well it looks alright to me in latest mozilla.

尝试使用这个,如果你面对的问题。

Try using this if you face problems

body { 
  background: url("./content/site_data/bg.jpg") no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  font-family: 'Lobster', cursive;
}

修改

至于OP从评论回答一些清除率

As some more clearance of answer to OP from comments

background: url("./content/site_data/bg.jpg") no-repeat center center fixed;

它的简写,

background-image: url("./content/site_data/bg.jpg");
background-repeat:no-repeat;
background-position: center center;
background-attachment:fixed;

在这里阅读更多

这篇关于CSS - 背景大小:盖;在Firefox中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆