【问题标题】:opera and @font-face歌剧和@font-face
【发布时间】:2013-11-27 05:28:28
【问题描述】:

我使用@font-face 将一种字体整合到我的网站中。尽管它在 ff/chome/safari 中显示良好,但在 Opera 中呈现困难。

我正在使用 Google 的字体 API;这是在我的 html 中:

<link 
     href='http://fonts.googleapis.com/css?family=Muli' 
     rel='stylesheet' 
     type='text/css' >

然后是我的 CSS:

     /* this is whats in the linked file */
@font-face 
{   font-family: 'Muli';
    font-style: normal;
    font-weight: 400;
    src: local('Muli'), url('http://themes.googleusercontent.com/static/fonts/muli/v2/    kU4XYdV4jtS72BIidPtqyw.woff') format('woff');
        }


    /* this is the css in my site */
body
{   font-family: 'Muli', sans-serif;
        }

我不确定为什么这不起作用:API 说它适用于 Opera 10.5 及更高版本...

【问题讨论】:

标签: css cross-browser opera font-face


【解决方案1】:

它是 font-weight: bold; 而不是 font-style: bold;font-style 值是“斜体”、“斜体”和“正常”。 font-weight 可以有“bold”、“bolder”、“lighter”、“normal”或数值 100、200、...、900。

【讨论】:

  • 我想知道为什么错误只出现一次。我已经解决了这个问题,但似乎仍然没有骰子...... Opera 仍然不会显示我的 sigma。
  • 嗯,我认为这是 DanMan 在他的链接中指出的原因,WOFF 仅从 11.10 开始支持。
【解决方案2】:

这是font-weight:bold,而不是font-style:bold

【讨论】:

    【解决方案3】:

    如果您在 font-face 声明中明确定义 font-weight: 400;,则该 font-face 将仅用于具有该字体粗细的文本。我不确定“400”是否与您在 body 选择器中要求的“正常”相同。

    那个,我希望你的实际字体 URI 中没有空格。

    【讨论】:

      【解决方案4】:

      试试双引号:

      @font-face 
      {   font-family: "Muli";
          ...
      

      更多信息在这里:Why won't Opera (11.00) display custom (@font-face) fonts?

      【讨论】:

        猜你喜欢
        • 2018-06-11
        • 2010-12-06
        • 2011-01-02
        • 2016-04-08
        • 2012-02-16
        • 2013-08-12
        • 1970-01-01
        • 2020-11-10
        • 2012-08-26
        相关资源
        最近更新 更多