font-face没有出现在Firefox上

时间:2011-12-13 04:37:12

标签: css font-face

我的@ font-face适用于我尝试过的所有其他浏览器,但在Windows上的Firefox上,它会加载字体资源,但会显示后备。以下是有问题的代码:

@font-face {
    font-family: 'VanillaRegular';
    src: url('http://dl.dropbox.com/u/19510731/ttfonts/Vanilla-webfont.eot');
    src: url('http://dl.dropbox.com/u/19510731/ttfonts/Vanilla-webfont.eot?#iefix') format('embedded-opentype'),
         url('http://dl.dropbox.com/u/19510731/ttfonts/Vanilla-webfont.woff'),
         url('http://dl.dropbox.com/u/19510731/ttfonts/Vanilla-webfont.ttf'),
         url('http://dl.dropbox.com/u/19510731/ttfonts/Vanilla-webfont.svg#VanillaRegular');
    font-weight: normal;
    font-style: normal;
}

然后我就这样嵌入了它:

.post h3 {
border-bottom:1px solid #c7e7fa;
color:#51514E;
font-size:22px;
font-weight:bold;
line-height:1.4em;
margin:0.25em 0 8px;
padding:0 0 4px;
font-family: "VanillaRegular", Arial, sans-serif;
}

我是否特别需要为Firefox做些什么,或者只是我的代码?

编辑:应该使用Firefox 8添加,最终产品在Blogger上。

2 个答案:

答案 0 :(得分:3)

将这些字体放在您自己的服务器上,它们会起作用。 Firefox无法外包字体。

答案 1 :(得分:0)

我相信这是因为你有

@font-face {

... Snip

font-weight: normal;
font-style: normal;
}

和你的css

.post h3 {
... snip

font-weight:bold;

... snip
}

除非您有更多代码,否则您需要另一个粗体字声明。

查看css3.info的文章。