【问题标题】:CSS Google fonts issue in FirefoxFirefox 中的 CSS Google 字体问题
【发布时间】:2015-05-02 06:16:31
【问题描述】:

我无法让 firefox 从 Google Fonts 加载自定义字体。我正在使用 Google 推荐的以下代码,但这在 Firefox 中不起作用。但是,它在 IE、Chrome 等中运行良好。

@import url('http://fonts.googleapis.com/css?family=Noto+Sans');
body, input, select, textarea{
    font-family: 'Noto Sans', sans-serif;
}

我在网上找到了一些建议删除“无衬线”部分的答案,但这只会导致 Firefox 使用其默认字体(这比它选择的“无衬线”字体更糟糕)。

有什么想法吗?

谢谢:)

【问题讨论】:

    标签: css firefox fonts


    【解决方案1】:

    我建议不要使用@import

    <link href这一行放到<head>中,并在css上调用它的名字,比如:

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

    在您的 css 文件中:

    .my-class {
        font-family: 'Noto Sans', sans-serif;
    }
    

    【讨论】:

      猜你喜欢
      • 2011-10-19
      • 2018-06-22
      • 2012-12-29
      • 2016-02-20
      • 1970-01-01
      • 2012-08-08
      • 2011-12-05
      • 2014-03-14
      • 1970-01-01
      相关资源
      最近更新 更多