gpt4 book ai didi

android - CSS - 背景大小 : cover; not working in Firefox

转载 作者:行者123 更新时间:2023-11-28 04:19:55 24 4
gpt4 key购买 nike

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 浏览器上,不在宽屏模式下。

该代码适用于 Chrome(Android + PC)甚至是普通的 Android 浏览器,但不适用于 Firefox(Android + PC)。有什么好的替代品吗?为什么它仍然不起作用?谷歌了很多次这个问题,但似乎没有其他人有这个问题。只有我吗?无论如何,我该如何解决?SO 上也有很多关于它的问题,但没有一个提供合法的解决方案,所以有人可以告诉我他们是否有 background-size: cover; firefox 也有问题吗?

所以基本上告诉我三件事:1. 为什么会这样?2. 有什么好的替代品吗?3.你也有这种情况吗?当然是在 Firefox 浏览器上。

Chrome 版本 35.0.1916.114 mFirefox 版本 29.0.1

注意:我可能已经在尝试修复它,所以有时您可能会看到一个完全奇怪的页面。稍等一下,然后重新加载。

最佳答案

enter image description here嗯,在我看来最新的 mozilla 没问题。

如果遇到问题,请尝试使用它

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 的更多回答的清除

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;

Read more here

关于android - CSS - 背景大小 : cover; not working in Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24104683/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com