【发布时间】:2013-12-24 00:47:01
【问题描述】:
我在我的网站上使用@font-face。
我的一个电话很简单:
@font-face
{
font-family: bebas;
src: url('bebas.TTF');
}
这似乎在 IE 9/10 中运行良好。
但是,我尝试过使用另一种字体来实现这一点:
@font-face
{
font-family: lobster;
src: url('lobster.OTF');
}
并且在IE中没有成功。
我在 Google 上搜索了答案,许多人建议使用 Font Squirrel Font Generator 来获取完整的代码,我在这里做了:
@font-face {
font-family: 'lobster';
src: url('lobster-webfont.eot');
src: url('lobster-webfont.eot?#iefix') format('embedded-opentype'),
url('lobster-webfont.woff') format('woff'),
url('lobster-webfont.ttf') format('truetype'),
url('lobster-webfont.svg#lobster_1.4regular') format('svg');
font-weight: normal;
font-style: normal;
}
但字体仍然无法正确显示。
我已将所有附加文件包含在正确的目录中 - 它无法在 IE 中运行。
谁能指出我正确的方向?
编辑:尝试将字体转换为 TTF - 也没有运气
EDIT2:使用的 CSS 示例:
#tickerlist LI
{
list-style-type: none;
font-family: lobster, Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
font-size: 40.3pt;
padding-top: 0px;
padding-left: 5px;
}
EDIT3:
尝试了字体文件的绝对路径 - 仍然没有影响
【问题讨论】:
-
首先,您从哪里获得字体,以及您使用的确切代码(包括 HTML 和 CSS)?无法从提供的数据中重建问题。
-
@JukkaK.Korpela 我从 Font Squirrel 获得字体。我在上面调用字体的地方添加了 CSS
-
是不是你需要为你的服务器添加 IE 字体的 MIME 类型?
-
CSS 中有一个大写的 LI。该页面不是 XHTML 文档吗?
标签: internet-explorer css fonts font-face