链接css中的字体文件在firefox中不起作用(但在其他所有浏览器中都有效)

时间:2013-08-24 13:49:11

标签: css firefox fonts

我有以下代码:

#entrance {
    margin: 20% auto auto auto;
    text-align: center;
    font-family: 'Baron Neue';
    src: url('fonts/baron.otf');
}

这允许文本以chrome中的所需字体呈现,即safari和opera,但不是firefox。我得到的只是新罗马时代。

1 个答案:

答案 0 :(得分:2)

使用@ font-face属性。

@font-face {  
   font-family: Baron Neue;   
   src: local('Baron Neue'),   
   url('fonts/baron.otf');  
   font-weight: 400; 
}

请参阅http://sixrevisions.com/css/font-face-guide/