javascript - HTML5 和 @font-face 与 IE

标签 javascript html fonts css font-face

在过去的 2 个小时里,我一直在尝试使用 font-squirrel 的工具包来渲染@font-face。查看this link并且您会看到在所有非 IE 浏览器中一切都很好,但在 IE 中它无法完全呈现...

这是我的字体代码:

@font-face {
    font-family: 'CartoGothicStdBook';
    src: url('../cartogothicstd-book-webfont.eot');
    src: url('../cartogothicstd-book-webfont.eot?#iefix') format('embedded-opentype'),
         url('../cartogothicstd-book-webfont.woff') format('woff'),
         url('../cartogothicstd-book-webfont.ttf') format('truetype'),
         url('../cartogothicstd-book-webfont.svg#cartogothicstdbook') format('svg');
    font-weight: normal;
    font-style: normal;
}

我错过了什么?字体和样式表都在根目录中(尽管我认为这没什么区别)。是因为 HTML5 标签(我使用的是 HTML5 shiv)不能使用 @font-face pre-IE9 吗?

希望很快能听到绝地编码员的消息,

最佳答案

您是否尝试过使用 http://www.modernizr.com/ 中的 polyfill - modernizer2.js而不是 html5 shiv。 @font-face 是 Modernizer 检测到的 css 功能,请参阅 http://www.modernizr.com/docs/#features-css

关于javascript - HTML5 和 @font-face 与 IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6749717/

相关文章:

javascript - 如何使用动态 url (slugs) 和 ng-include 在 Angular JS 中正确返回 404?

html - 带有图像的链接不会留在中间

javascript - 将输入数字/文本添加到范围

javascript - window.close() 不起作用 - 脚本可能只关闭它打开的窗口

javascript - 上面的 Div 另一个 JQuery 脚本不起作用!

javascript - html:悬停表格列

ios - 无法在 Xcode 的 Storyboard 中为导航栏设置字体

android - 如何支持 Android 默认语言环境中不存在的自定义语言环境字体

ruby - 在 UBUNTU 中从 TTF 文件中查找 FontName

javascript - 试图让正则表达式从 camelCase 和 CamelCase 中识别和提取单词