在过去的 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/