【问题标题】:@font-face is not working as it should@font-face 没有正常工作
【发布时间】:2013-03-07 21:06:37
【问题描述】:

所以我使用了一些非常简洁的字体,而且我以前从未遇到过@font-face 的任何问题,但是,这些似乎不起作用。 :( 任何想法出了什么问题?

CSS 路径:http://carlpapworth.com/friday-quiz/css/style.css

字体文件夹路径:http://carlpapworth.com/friday-quiz/css/fonts

@font-face {
font-family: silverfake;
font-weight: 100;
font-style: normal;
src: url('fonts/silverfake.otf');
}

@font-face {
font-family: molesk;
font-weight: 100;
font-style: normal;
src: url('fonts/molesk.otf');
}

@font-face {
font-family: ballpark;
font-weight: 100;
font-style: normal;
src: url('fonts/ballpark.TTF') format("truetype");
}

【问题讨论】:

标签: css fonts font-face


【解决方案1】:

您可能没有正确链接到字体。 它通常是小东西;

src: url('../fonts/silverfake.otf');

而不是

src: url('fonts/silverfake.otf');

尝试使用fontsquirrel webfont generator 以确保所有内容都正确链接,并且对浏览器友好。

【讨论】:

  • 我认为不是他的情况,请参阅他的链接。
  • 链接需要我登录。无法检查出来。
  • 我也没有,但是你可以看到他的fonts文件夹在css文件夹里面。
【解决方案2】:

至少找到了让 Molesk 工作的答案:

@font-face {
font-family:"molesk";
src:url("molesk.eot?") 
format("eot"),url("molesk.woff") 
format("woff"),url("molesk.ttf") 
format("truetype"),url("molesk.svg#molesk") 
format("svg");
font-weight:normal;
font-style:normal;}

【讨论】:

    猜你喜欢
    • 2016-05-31
    • 2023-03-24
    • 2013-03-03
    • 2018-07-17
    • 2014-10-12
    • 2019-01-06
    • 1970-01-01
    • 1970-01-01
    • 2017-04-29
    相关资源
    最近更新 更多