声明这种.otf字体有什么问题?



这是我的声明代码:

@font-face {
    font-family: 'MyOwnFont';
    font-style: normal;
    font-weight: 400;
    src: url('../webfonts/MyOwnFont.otf') format("opentype");
}

但是当我使用它时:

body
{
    font-family:'MyOwnFont';
}

我在网页上看不到它。声明有什么问题?

通常最好通过web-font生成器运行字体,例如 http://www.fontsquirrel.com/tools/webfont-generator

这样,它将生成字体的otfttf等版本,该字体将得到更好的支持,而不仅仅是对otf字体的引用。

@font-face{ 
    font-family: 'MyWebFont'; 
    src: url('WebFont.eot'); 
    src: url('WebFont.eot?#iefix') format('embedded-opentype'), 
        url('WebFont.woff') format('woff'), 
        url('WebFont.ttf') format('truetype'), 
        url('WebFont.svg#webfont') format('svg'); 
}