无法使用Internet Explorer 8获取@ font-face [英] Can't get @font-face with Internet Explorer 8

查看:96
本文介绍了无法使用Internet Explorer 8获取@ font-face的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让我的客户端自定义字体在IE8中显示。它显示在IE 9& 7和Chrome obv。我不知道为什么这一个版本的IE会导致麻烦。这是我的html中的include语句

I'm having trouble getting my client's custom font face to show up in IE8. It shows up in IE 9 & 7, and Chrome obv. I'm not sure why this one version of IE would be causing trouble. Here is my include statement in my html

<!--[if IE 8]>
    <link rel="stylesheet" type="text/css" href="../styles/ie/cherokee_ie.css" />
    <![endif]-->

这里是cherokee_ie.css档案

And here is the cherokee_ie.css file

@font-face {
font-family: 'cherokee';
src: url('../../custom.eot');
src: url('../../custom.eot') format('embedded-opentype'),
src: local('☺'), url('../../font/custom.woff') format('woff'), url('../../font/custom.ttf')             format('truetype'), url('../../font/custom.svg') format('svg');
font-weight: normal;
font-style: normal;
}

h1 ul li {
  font-family:cherokee;
}

我不太确定src上的笑脸: ,但我发现这个代码在另一个SO问题,它使它在IE7(或至少在我可以通过BrowserLab看到)完美工作。

I'm not really sure what the smiley face on src: local is doing, but I found this code in another S.O. question that made it work perfectly in IE7 (or at least as far as I can see through BrowserLab.)

此外,有更快的方式生成视图比Browserlab?

Also, is there a faster way to generate views than Browserlab?

推荐答案

删除IE条件并将其放入您的CSS

Remove the IE Conditional and put this in your CSS

@font-face {
    font-family: 'cherokee';
    src: url('../../custom.eot');
    src: url('../../custom.eot?#iefix') format('embedded-opentype'),
         url('../../font/custom.woff') format('woff'),
         url('../../font/custom.ttf') format('truetype'),
         url('../../font/custom.svg#cherokee') format('svg');
    font-weight: normal;
    font-style: normal;

}

也可以对自定义字体使用'...'字体像这样

also use '...' for custom font-face fonts like so

h1 ul li {
  font: 18px/27px 'cherokee', Arial, sans-serif;
}

同时检查您的路径设置是否正确。

Also check whether your paths are set correctly.

这篇关于无法使用Internet Explorer 8获取@ font-face的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆