问题描述
我尝试使用 background-size:cover
将背景图片套用到容器。
这里是我的小提琴:
I'm trying to fit a background image to it's container using background-size:cover
.here is my fiddle : The Fiddle
它适用于所有浏览器,但不工作在Android本机浏览器..
任何人都有任何解决方案吗?感谢
it works in all browsers but not working in Android native browser..anybody has any solution please ? thanks
推荐答案
在搜索了这个问题,没有找到解决方案后,我删除了CSS文件样式的背景图像,并使用了内联样式在HTML代码中。 Android原生浏览器的问题已解决。
After searching about this problem and finding no solution, I deleted background-image from CSS file styles and used an inline style in HTML codes. The problem with android native browser is solved.
我更新了小提琴,它在Android原生浏览器中工作。
I updated the fiddle and it's working in android native browser.
似乎那android也有解析背景格式的问题,像这样:
it seems that android also has problem with parsing background format like this :
background: url('...') fixed center center / cover;
,我们应该将背景图片与其他内容分开,并使用内联,然后分别使用每个选项在css文件,像这样:
and we should separate the background-image form others and use it inline, and then use each option separately in css file, like this :
background-size: cover;
background-position: center center;
这篇关于背景大小:盖不工作在Android本机浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!