背景图像和渐变在 iPad 上不显示

发布于 2024-12-19 06:20:52 字数 338 浏览 1 评论 0原文

我有一个“选定”类,并且定义了嵌入的背景图像和 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%);
}

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

I have a 'selected' class, and I've defined an embedded background image along with a webkit gradient. It works on safari on my iPod touch running iOS 5.0.1, but neither the image or the gradient shows on my iPad running iOS 4.3.4. Any tips on making this more compatible?

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

Note that the image displays correctly everywhere when I don't include the gradient.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演出会有结束 2024-12-26 06:20:52

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

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

I worked around this by using the CSS before attribute: http://www.htmldog.com/reference/cssproperties/content/

.selected::before { content: url(data:image/png;base64,blablablabl==); }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文