1

我正在尝试在外部 CSS 文件中加载数据 uri。这是代码:

.icon-blank-page-large {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAA3NCSVQICAjb4U/gAAAAXVBMVEX///+vr6+tra2mpqalpaWdnZ3///+UlJT7+/v39/f19fXz8/Pr6+vp6enn5+fj4+Ozs7OqqqqmpqalpaWFhYWRkZGNjY2Li4uJiYl+fn56enp4eHh2dnZycnJwcHBeRFztAAAAH3RSTlMAM1WImbvd3e7u7u7u7u7u7u7u7u7/////////////xBl9GgAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAUdEVYdENyZWF0aW9uIFRpbWUANi8xLzEzOKlF0AAAAMNJREFUSInt1tsSgiAUhWGsxNJOHsoQ1n7/xyxLaYSNY01XDf81nwoXsoUYShW4skTwNYDp3LQm0it2fQrUp610y4nAC4XSW91H1EKvGQBzDIDiCmwY0Pnf8wJy13ICHbu+B7LgxBxg3xEG+/6wbp4Ig/MgdLIIXMiWLQL5W2ARsBXmQyB1BH8EKNDvQNx03HTc9HdA85diGASuXdve+d0r1POggpqAx+hQMaPD2KEE0gl4Difam07GDNAIp8D4M6Ts8++7/VXclnc6pwAAAABJRU5ErkJggg);

}

它适用于 Chrome 和 Firefox,但 Safari 无法加载图像并记录以下错误:

Failed to load resource: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -10.)

有任何想法吗?

4

1 回答 1

5

此错误是由不正确的编码引起的。base64 字符串的一部分丢失了,尽管它在 Chrome 和 FF 中仍然有效。

于 2013-02-11T04:35:40.670 回答