css字体表面根本不起作用

时间:2013-04-12 06:28:03

标签: css3 font-face webfonts

在我的一个网站中,我使用了Ænigma Scrawl 4 BRK font(as it is showing in my photoshop font family box)。现在我想在我的页面中使用相同的字体。所以为此我只是去FontSquiirel网站生成css样式。在那里,我得到了我的css文件,其中包含不同扩展名的字体,如.svg, .ttf, .woff。我只是将所有字体粘贴到我的文件夹中,然后在style.css文件中使用了相同的转换后的css。生成的css就像这样

   font-family: 'nigma_scrawl_4_brkregular';
    src: url('aescrawl-webfont.eot');
    src: url('aescrawl-webfont.eot?#iefix') format('embedded-opentype'),
         url('aescrawl-webfont.woff') format('woff'),
         url('aescrawl-webfont.ttf') format('truetype'),
         url('aescrawl-webfont.svg#nigma_scrawl_4_brkregular') format('svg');
    font-weight: normal;
    font-style: normal;

但毕竟我的字体样式没有改变。我正在检查firefox和chrome。我已经清除了浏览器中的所有缓存和cookie。有人可以告诉我这里有什么不对吗?任何帮助和建议都会很明显。感谢

2 个答案:

答案 0 :(得分:0)

@font-face {
font-family: 'nigma_scrawl_4_brkregular';
.
.
.
.
font-style: normal;

}

答案 1 :(得分:0)

试试这个

@font-face{
    font-family : "myCustomFont";
    src:url(aescrawl-webfont.ttf);
}

body{
    font-family:"myCustomFont", Arial;
}