html - 背景图像不适用于 iPhone/iPad

标签 html ios css iphone background-image

您好,我的 background-image 有问题在 Apple 设备 (iPhone/iPad) 上 我的背景在所有浏览器和 Android 设备上看起来都是我想要的,而不是在 Apple 设备上

在浏览器中像这样:Safari, Firefox, Chrome, Opera, Edge, IE

Firefox,Chrome, Opera, Safari, Edge, IE

在 Android 上喜欢这个

Samsung, LG, Sony

在 Apple 设备上像这样

iPhone, iPad

对于 HTML 它只是一个普通的 <div class="hero"> </div>

这是我的 CSS (sass)

.hero
    width: 100%
    height: 100%
    position: relative
    background:
        image: url(../image/pics/thailand.jpg)
        position: center
        size: cover
        attachment: fixed

This is the page

我已经尝试了“可能已经有了我的答案的问题”中的一些解决方案,但对我没有任何帮助

谢谢你的帮助!!!!

最佳答案

我尝试了很多解决方案,但我不想使用 JS,所以出于某种原因,修复的属性附件在 IOS 上无法正常工作,所以我为媒体做了这个,现在图片看起来不错,只是不再修复了

 @media screen and(max-width:800px)
    .hero
        background:
            attachment: scroll

如果有人给我一个让我开心的其他解决方案

谢谢

关于html - 背景图像不适用于 iPhone/iPad,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37304626/

相关文章:

javascript - knockout 循环中的嵌套绑定(bind)

html - 为什么页面样式被外部 CSS 文件覆盖?

ios - 为什么 xcode 调试库大小小于发布库

ios - 如何为具有不透明主体的 UITableView header 设置清晰的背景

javascript - 使用 Html 和 javascript 重置密码

ios - 非法配置错误xcode6,我可以禁用它吗?

html - :before element in back of parent element

html - 强制 <summary> 显示为 :inline instead of inline-block

javascript - 从没有类和 id 的 anchor 标记更改 href

html - 使用css3在图像周围环绕文字