【问题标题】:background image and gradient not displaying on iPad背景图像和渐变不显示在 iPad 上
【发布时间】:2011-12-02 00:47:22
【问题描述】:

我有一个“选定”类,并且我已经定义了一个嵌入的背景图像以及一个 webkit 渐变。它适用于运行 iOS 5.0.1 的 iPod touch 上的 safari,但运行 iOS 4.3.4 的 iPad 上没有显示图像或渐变。有什么技巧可以让这更兼容吗?

.selected {
  background:url(data:image/png;base64,blablablabl==) 14px center no-repeat, -webkit-linear-gradient(bottom, red 0%, blue 100%);
}

请注意,当我不包含渐变时,图像在任何地方都能正确显示。

【问题讨论】:

    标签: ipad css webkit mobile-safari compatibility


    【解决方案1】:

    我通过使用 CSS before 属性解决了这个问题:http://www.htmldog.com/reference/cssproperties/content/

    .selected::before { content: url(data:image/png;base64,blablablabl==); }
    

    【讨论】:

      猜你喜欢
      • 2013-09-30
      • 2018-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-07
      • 2015-03-15
      • 1970-01-01
      相关资源
      最近更新 更多