CSS @font-face 在 IE8 中不起作用
我曾尝试阅读多篇有关如何在 IE 中处理自定义字体的文章,但它们似乎对我不起作用。我尝试将字体转换为 EOT
,但这似乎也不起作用。我不确定我做错了什么,所以我将发布我的代码
@font-face {
font-family: "Klavika Regular";
src: url('../fonts/klavika.eot');
src: local('☺'), url('../fonts/klavika.woff') format('woff'), url('../fonts/klavika.ttf') format('truetype'), url('../fonts/klavika.svg') format('svg');
font-weight: normal;
font-style: normal;
}
I have tried reading multiple articles on how to deal with custom fonts in IE, but they never seemed to work for me. I tried converting the fonts to EOT
, but that didn't seem to work either. I am not sure what I am doing wrong, so I will post my code
@font-face {
font-family: "Klavika Regular";
src: url('../fonts/klavika.eot');
src: local('☺'), url('../fonts/klavika.woff') format('woff'), url('../fonts/klavika.ttf') format('truetype'), url('../fonts/klavika.svg') format('svg');
font-weight: normal;
font-style: normal;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这适用于 ie8/9
http://dev.bowdenweb.com/a /fonts/serif/alegreya/demo.html
this works in ie8/9
http://dev.bowdenweb.com/a/fonts/serif/alegreya/demo.html
如果 IE8 认为它支持除了下面列出的
eot
之外的任何其他格式,那么它可能会尝试使用该格式。也许您可以使用 IE8 hack,这样只有 IE8 才会读取最后一个
src
行,从而加载 .eot。if IE8 thinks it supports any other format other than
eot
of the ones listed below, then it will probably try to use that one. Maybe you could use a IE8 hack, likeso only IE8 will read the last
src
line and thus load the .eot.在 FontSquirrel Generator 上尝试 @font-face 的三种 CSS 格式(在“专家... “模式 > 在“CSS 格式:”>“更多信息”部分中)
Try three kinds of CSS Formats for @font-face on FontSquirrel Generator (in "EXPERT..." mode > in section "CSS Formats:" > "more information")
值得检查一下您的 .htaccess 文件是否允许该文件类型。
It's worth checking to see if your .htaccess file allows the file type.