0

我正在准备一个简单的网站。但是我的字体在 Google Chrome 上不起作用。

这是我的页面

我的 CSS 代码:

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,600);

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

我的 web.config 数据

<system.webServer>
    ...
    <staticContent>
      <remove fileExtension=".svg" />
      <remove fileExtension=".eot" />
      <remove fileExtension=".woff" />
      <remove fileExtension=".otf" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />
      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
      <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
      <mimeMap fileExtension=".otf" mimeType="font/otf" />
    </staticContent>
</system.webServer>

它在 Firefox 上运行良好,但在 Chrome 上运行不佳。我在我的项目中尝试了“字体文件夹方法”和“ttf 字体”,但它没有改变。

我怀疑 woff 文件,但我无法更改它。

我怎样才能解决这个问题?

4

2 回答 2

1

尝试使用它 - 将此链接粘贴到 head 部分:

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
于 2013-12-16T16:30:24.850 回答
1

你用的是什么版本的chrome?似乎在版本 31.0.1650.63 上工作正常。

body {
font-family: 'Open Sans', sans-serif;}
于 2013-12-16T16:36:48.503 回答