背景大小:封面在 android 本机浏览器中不起作用 [英] background-size:cover not working in android native browser
问题描述
我正在尝试使用 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 文件样式中删除了 background-image 并在 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.
我更新了小提琴,它在安卓原生浏览器中运行.
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 本机浏览器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!