【发布时间】:2014-01-04 03:00:52
【问题描述】:
我正在准备一个简单的网站。但是我的字体在 Google Chrome 上不起作用。
这里是my page
我的 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 文件,但无法更改。
我该如何解决这个问题?
【问题讨论】:
-
您的 web.config 不会对此事产生任何影响,因为那是针对您的服务器的,但字体是从 Google 的服务器加载的。你怎么知道它不起作用?我在 Chrome 中加载了您的网站,对我来说它看起来像是在 Open Sans 中......在 Chrome 的工具中,计算的样式确实是 Open Sans。 (请参阅here 了解如何检查真正使用的字体。)
标签: asp.net css font-face woff