我下载了一些otf字体,然后将它们转换为eot使用:https://onlinefontconverter.com但是当我在IE8中查看网站时,字体不显示(它们显示在Chrome,Firefox,Opera和Android中)。我的代码或eot一定有问题。有谁知道什么是错的?为什么IE8不能加载我的eot文件?
(这里下载的Roboto:http://www.fontsquirrel.com/fonts/roboto)
(在这里将它转换:https://onlinefontconverter.com)
styles.css的
@font-face
{
font-family: RobotoCondensed;
src: url("Roboto-Condensed.eot");
}
@font-face
{
font-family: RobotoCondensed;
src: url("Roboto-Condensed.ttf");
}
.myDiv
{
font-family: RobotoCondensed, Arial, Helvetica;
font-size: 10px;
color: #e8e8e8;
}
的index.html(相关代码)
<div class="myDiv">Some font in here that shows incorrectly as Arial!</div>
样式表和字体位于同一个文件夹中。
为什么没有'FONT-FAMILY =的Roboto-Condensed'? – elclanrs 2012-03-09 02:06:11
你可以任意命名。 – 2012-03-09 02:13:55
您是否尝试过在字体松鼠中使用字体生成器? http://www.fontsquirrel.com/fontface/generator - 为您提供所有浏览器所需的所有字体和CSS。 – 2012-03-09 04:42:15