我正在尝试所有这些不同的方式:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
@font-face {
font-family: "cursivas";
src: url(Freestyle.ttf) format("truetype");
}
@font-face {
font-family: "tabs";
src: url(FrutigerLTStd-Bold.otf) format("truetype");
}
@font-face {
font-family: 'topMenuFont';
src: url('frutigerltstd-bold-webfont.eot');
src: url('frutigerltstd-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('frutigerltstd-bold-webfont.woff') format('woff'),
url('frutigerltstd-bold-webfont.ttf') format('truetype'),
url('frutigerltstd-bold-webfont.svg#FrutigerLTStd65Bold') format('svg');
font-weight: normal;
font-style: normal;
}
p.customfont {
font-family: "cursivas";
}
p.tabs{
font-family:'tabs';color:#8e8e8e;
}
p.menu{
font-family:'topMenuFont';
}
p{
font-size:30px;
color:#8e8e8e;
}
</style>
</head>
<body>
<p class="customfont">FAMILIAS <span style="color:blue">RESERVAS</span></p>
<p class="tabs">FAMILIAS <span style="color:blue">RESERVAS</span></p>
<p class="menu">FAMILIAS <span style="color:blue">RESERVAS</span></p>
<p>FAMILIAS <span style="color:blue">RESERVAS</span></p>
</body>
</html>
路径没问题,因为它们都在 FF 中工作,
知道我错过了什么吗?
最佳答案
尝试描述的语法 here :
@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
url('myfont-webfont.woff') format('woff'),
url('myfont-webfont.ttf') format('truetype'),
url('myfont-webfont.svg#svgFontName') format('svg');
}
从 fontsquirrel.com 获得链接,他们将它用于所有生成的字体。您还可以查看 Google Web Font生成 css (它只显示您使用的浏览器的字体)
并将其加载到外部 css 文件中,这也可能会解决一些问题。
关于css - @font-face 在 IE7 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7888146/