2

フォントが表示されない理由を確認するにはどうすればよいですか?

私は Chrome を使用しているため、.ttf が機能するはずです。URL バーを使用してファイルに移動できることを確認しました。ダウンロードできるので、アクセス許可は問題ありません。

@font-face を宣言するページがあります。

@font-face {
  font-family: 'entypo';
  src: url('/css/fonts/entypo.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

p { font-family: 'entypo'; }
4

2 に答える 2

4

@font-face をブロック内に置くことはできません。CSS ファイルの先頭に配置するのが一般的な方法です。

ソース:

#lookgram {
  @font-face {
    font-family: 'entypo';
    src: url("/entypo.eot");
    src: url("/entypo.eot?#iefix") format("embedded-opentype"), url("/entypo.woff") format("woff"), url("/entypo.ttf") format("truetype"), url("/entypo.svg#entypo") format("svg");
    font-weight: normal;
    font-style: normal;
  }

  @font-face {
    font-family: 'entypo_social';
    font-style: normal;
    font-weight: 400;
    src: url("/css/fonts/entypo-social.woff") format("woff");
  }

  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "lucida grande", tahoma, verdana, arial, sans-serif;
}
于 2013-03-05T17:34:06.153 に答える