(真的)长背景图像无法在 iPad Safari 上呈现 [英] (Really) Long Background Image Does Not Render on iPad Safari

查看:28
本文介绍了(真的)长背景图像无法在 iPad Safari 上呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些未知原因,iPad Safari 无法显示很长的背景图像.在我的示例中,背景图片为 1,000 x 10,000 像素.相同的示例适用于任何桌面浏览器,例如Safari、Firefox 等

我知道 CSS 中的 background-repeat 但不幸的是它不适用于我的特定情况.

解决方案

Mobile Safari 对二次采样前将显示的背景图像大小有限制,由于背景的大小,您可能会遇到此问题:<块引用>

解码的 GIF、PNG 和 TIFF 图像的最大大小为 3 兆像素(对于 RAM 小于 256 MB 的设备)和 5 兆像素(对于大于或等于 256 MB RAM 的设备.

也就是说,对于小于 256 MB RAM 的设备,确保宽度 * 高度 ≤ 3 * 1024 * 1024.请注意,解码后的尺寸远大于图像的编码尺寸.

请参阅:了解 iOS 资源限制

For some unknown reasons, iPad Safari doesn't display a really long background image. In my example, the background image is 1,000 x 10,000 pixels. The same example works on any desktop browser e.g. Safari, Firefox, etc.

I am aware of the background-repeat in CSS but unfortunately it isn't applicable in my specific case.

解决方案

Mobile Safari has limits to what size background images it will display before subsampling, you may be getting hit by this problem because of the size of your background:

The maximum size for decoded GIF, PNG, and TIFF images is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM.

That is, ensure that width * height ≤ 3 * 1024 * 1024 for devices with less than 256 MB RAM. Note that the decoded size is far larger than the encoded size of an image.

see: Know iOS Resource Limits

这篇关于(真的)长背景图像无法在 iPad Safari 上呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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