【问题标题】:Opera doesn't display outside fontsOpera 不显示外部字体
【发布时间】:2014-04-22 10:44:02
【问题描述】:

下一个问题 - Opera 不显示外部字体。下一个代码:

@font-face {
    font-family: "Ubuntu-Italic"; 
    src:url('../fonts/Ubuntu-I.eot'),
    src:url('../fonts/Ubuntu-I.eot?#iefix') format('opentype'),
    src:url('../fonts/Ubuntu-I.woff') format('woff'),
    src:url('../fonts/Ubuntu-I.otf') format('opentype'),
    src:url('../fonts/Ubuntu-I.ttf') format('truetype'),
    src:url('../fonts/Ubuntu-I.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

看起来一切正常 - 双引号,“woff”格式...但它不适用于 Opera。

【问题讨论】:

  • 有很多这样的@StackOverflow,例如:stackoverflow.com/questions/9506837/…
  • pc-shooter,缓存被清除,字体不是来自 Google-Fonts arma,谢谢你,现在我正在努力理解这个,我之前在这个主题上阅读的所有内容都无法使用。

标签: css fonts font-face opera


【解决方案1】:

属性 src 需要一个 URL 列表。
或者使用多个 src 定义。
你混合了它。它不是有效的 CSS。

您的代码:

src:url('../fonts/Ubuntu-I.eot'),
src:url('../fonts/Ubuntu-I.eot?#iefix') format('opentype'),
src:url('../fonts/Ubuntu-I.woff') format('woff'),
src:url('../fonts/Ubuntu-I.otf') format('opentype'),
src:url('../fonts/Ubuntu-I.ttf') format('truetype'),
src:url('../fonts/Ubuntu-I.svg') format('svg');

应该是:

src:url('../fonts/Ubuntu-I.eot'),
    url('../fonts/Ubuntu-I.eot?#iefix') format('opentype'),
    url('../fonts/Ubuntu-I.woff') format('woff'),
    url('../fonts/Ubuntu-I.otf') format('opentype'),
    url('../fonts/Ubuntu-I.ttf') format('truetype'),
    url('../fonts/Ubuntu-I.svg') format('svg');

并且为不同的类型发送正确的 MIME-Type?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 2014-09-26
    • 1970-01-01
    • 2021-09-01
    相关资源
    最近更新 更多