css - @font-face 不在服务器上时在 IE 中不工作

标签 css internet-explorer iis font-face

我已经为网站上的许多字体实现了@font-face。这是一个在 IIS7 上托管的 asp 网站。目前我正在使用 FF23、Chrome、IE8/9/10 进行测试。我在使用 IE 中的字体时遇到了一些困难。当我不从我的服务器访问网页时,字体将在 FF 和 Chrome 上正确呈现,但是在所有 IE 浏览器上它们不会。当我访问服务器 (2008 r2) 上的网站时,我使用的是相同的 URL(完全限定域名)。当我不在服务器上访问时,我使用的是相同的完全限定域名。字体和网站都托管在同一台机器(同一域)上。在 FF 或 Chrome 中没有@font-face 抛出的错误,不知道如何检查 ie。

@font-face {
    font-family: 'sf_movie_posterregular';
    src: url('./fonts/customtitle-webfont.eot');
    src: url('./fonts/customtitle-webfont.svg#sf_movie_posterregular') format('svg'),
         url('./fonts/customtitle-webfont.eot?#iefix') format('embedded-opentype'),
         url('./fonts/customtitle-webfont.woff') format('woff'),
         url('./fonts/customtitle-webfont.ttf') format('truetype');

    font-weight: normal;
    font-style: normal;

}

最佳答案

将 woff 作为地雷类型添加到 IIS。 (.woff, application/font-woff)

转到 IIS 管理器,选择您的网站,然后从右侧选择 MIME 类型。

关于css - @font-face 不在服务器上时在 IE 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18638892/

相关文章:

javascript - 点击页面刷新;重新出现两个输入元素?

javascript - 动画创建一个 div 来移动我的页面内容?

internet-explorer - IE 11 "bulletproof"字体和后备字体不起作用

asp.net-mvc - 在 IIS7 上设置 mvc 应用程序?

iis - 如何安全地将所有 IIS 设置从一台服务器导出到另一台服务器?

sql-server - IIS 服务器的 .svc 处理程序

html - 更改移动 megamenu 下拉菜单的背景颜色

css - :first-letter when the first letter is immediately followed by a space? float 后如何保留空格

javascript - 以编程方式将 IE8 设置为隐私浏览模式

html - 虚拟服务器无法检测浏览器版本