【问题标题】:Background Images not showing up in IOS devicesIOS 设备中不显示背景图像
【发布时间】:2017-08-02 23:33:57
【问题描述】:

我有几个带有背景图像的 div,但没有一个显示在任何 ios 设备(iphone + ipad)中。它在其他任何地方都有效。

我已将照片的尺寸缩减为 635 x 635。我不确定这是图像问题还是 CSS 问题。不幸的是,我无法发布指向实际图像的链接。但这是我拥有的代码示例:

图片的url由Thumbor生成。

.section {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding-left: 10%;
  display: block;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  padding-top: auto;
  padding-left: 0% !important;
}
.caption {
  margin: 5%;
}
<section class="section" id="image_text3" style="background: url(//placehold.it/635/635) no-repeat fixed top;">
  <div class="caption">
    <p>caption</p>
  </div>
</section>

【问题讨论】:

  • text3 之间没有空格"style= 你应该有 text3" style=
  • 好的,谢谢。不幸的是,这种方法没有解决问题。

标签: html ios css


【解决方案1】:

如果我能给你确切的解决方案,我愿意为这个问题贡献我的一份力量。

http://caniuse.com/#search=background-image 告诉 iOS 在 background-size:cover 属性方面存在一些问题。

【讨论】:

    【解决方案2】:

    我刚刚回答了一个类似的问题。查看this question 的答案。我还 did a blogpost on it 用例子解释了这一点。

    【讨论】:

      猜你喜欢
      • 2021-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-21
      • 2015-06-21
      • 2023-02-20
      相关资源
      最近更新 更多