【发布时间】:2013-05-27 11:24:42
【问题描述】:
我能够在 chrome 和 Firefox 中成功使用 @font-face,但在 IE 中却没有:
font-family: 'Market_Deco';
src: url('fonts/Market_Deco.ttf');
这在IE中不起作用,所以我尝试在转换并添加EOT文件后添加这一行:
src: url('fonts/Market_Deco.eot') format ('eot');
这仍然不起作用,所以我删除了 .ttf 引用并只使用了 EOT 行。这在 IE 中修复它并在其他任何地方破坏它。我开始看这里,每个人都推荐字体松鼠,所以我尝试了:
@font-face {
font-family: 'market_decoregular';
src: url('fonts/market_deco-webfont.eot');
src: url('fonts/market_deco-webfont.eot?#iefix') format('embedded-opentype'),
url('font/market_deco-webfont.woff') format('woff'),
url('fonts/market_deco-webfont.ttf') format('truetype'),
url('fonts/fontmarket_deco-webfont.svg#market_decoregular') format('svg');
font-weight: normal;
font-style: normal;
}
我将四个新字体文件添加到我的字体文件夹中,更新了 CSS,现在它可以在零个浏览器中使用。我在这里遗漏了什么吗?
【问题讨论】:
-
url('font/market_deco-webfont.woff') format('woff'),为什么这一行使用“font”而不是“fonts”? -
呃——这就是答案。