请注意,您可能还对以下内容感兴趣:
自定义网页字体在 IE9 中不起作用
其中包括您在下面看到的 CSS 的更具描述性的细分(并解释了使其在 IE6-9 上更好地工作的调整)。
@font-face {
font-family: 'Bumble Bee';
src: url('bumblebee-webfont.eot');
src: local('☺'),
url('bumblebee-webfont.woff') format('woff'),
url('bumblebee-webfont.ttf') format('truetype'),
url('bumblebee-webfont.svg#webfontg8dbVmxj') format('svg');
}
@font-face {
font-family: 'GestaReFogular';
src: url('gestareg-webfont.eot');
src: local('☺'),
url('gestareg-webfont.woff') format('woff'),
url('gestareg-webfont.ttf') format('truetype'),
url('gestareg-webfont.svg#webfontg8dbVmxj') format('svg');
}
body {
background: #fff url(../images/body-bg-corporate.gif) repeat-x;
padding-bottom: 10px;
font-family: 'GestaRegular', Arial, Helvetica, sans-serif;
}
h1 {
font-family: "Bumble Bee", "Times New Roman", Georgia, Serif;
}
以及您的后续问题:
Q.例如,我想使用诸如“Bumble bee”之类的字体。我怎样才能@font-face
使该字体在用户的计算机上可用?
请注意,我不知道您的 Bumble Bee 字体或文件的名称是什么,因此请进行相应调整,并且 font-face 声明应该在您使用它之前(在之前),如上所示。
问:我还可以使用其他@font-face
字体“GestaRegular”吗?我可以在同一个样式表中使用两者吗?
正如我在示例中所示,只需将它们一起列出即可。没有理由不能同时声明两者。所做@font-face
的只是指示浏览器下载并提供字体系列。见:http: //iliadraznin.com/2009/07/css3-font-face-multiple-weights