Mat*_*nak 9 html css font-face internet-explorer-8
我无法在IE8中显示客户端的自定义字体.它出现在IE 9和7以及Chrome obv中.我不确定为什么这个版本的IE会造成麻烦.这是我在html中的include语句
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="../styles/ie/cherokee_ie.css" />
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
这是cherokee_ie.css文件
@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;
}
Run Code Online (Sandbox Code Playgroud)
我不太确定src上的笑脸是什么:local正在做什么,但是我在另一个SO问题中找到了这个代码,这使得它在IE7中完美运行(或者至少我通过BrowserLab可以看到.)
另外,有没有比Browserlab更快的方式生成视图?
删除 IE 条件并将其放入 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;
}
Run Code Online (Sandbox Code Playgroud)
还可以使用 '...' 来表示自定义字体,如下所示
h1 ul li {
font: 18px/27px 'cherokee', Arial, sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
还要检查您的路径设置是否正确。