2017-12-13 14 views
0

私のコードを修正するのを助けてください。 私のカスタムフォントは、私が開いているブラウザではレンダリングされていないようです。カスタムWebfontがどのブラウザにもレンダリングされていません

ここに私のCSSコードです。

@font-face{ 
font-family: 'Guildford'; 
src: url('../fonts/guildford_pro_titling-webfont.woff') format('woff'), 
src: url('../fonts/guildford_pro_titling-webfont.woff2') format('woff2'), 
src: url('../fonts/guildford_pro_titling-webfont.eot') format(embedded-opentype), 
src: url('../fonts/guildford_pro_titling.otf') format('opentype') !Important;} 

body { 
font-family: 'Guildford', sans-serif; 
background-image: url(../img/staropaquebackground.png); 
background-size: cover; 
background-attachment: fixed; 
background-repeat: no-repeat; 
color: #ffffff;} 
+1

URLをカンマ区切りにしているときに、すべての行に 'src'が必要ないと確信しています。 – DBS

答えて

-1

これを試してみてください:宣言:

@font-face{ 
font-family: 'Guildford'; 
src: url('../fonts/guildford_pro_titling-webfont.woff') format('woff'), 
url('../fonts/guildford_pro_titling-webfont.woff2') format('woff2'), 
url('../fonts/guildford_pro_titling-webfont.eot') format(embedded-opentype), 
url('../fonts/guildford_pro_titling.otf') format('opentype') !important; 
} 

body { 
font-family: 'Guildford', sans-serif; 
background-image: url(../img/staropaquebackground.png); 
background-size: cover; 
background-attachment: fixed; 
background-repeat: no-repeat; 
color: #ffffff; 
} 

あなたは基本的にはセミコロンでカンマを交換し、複数の 'SRC' を削除する必要があります。 今後このような問題を避けるために、コード検証機能付きのコードエディタをお勧めします。

enter image description here

+0

いいえ。複数の値を指定するのではなく、 'src'を再宣言しました。 – Quentin

+0

@Quentinあなたは正しいです、私の答えを編集しました。 – S1awek

+0

ありがとう、しかし、それはまだフォントを呼び出さなかった。 –

0

あなたがused a validator場合はピックアップされるようなエラーがあります。 the example on MDN

ルック:

@font-face { 
font-family: "Open Sans"; 
src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), 
     url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); 
} 

すべてのURLの前にsrc:を指定しないでください。

プロパティ名は一度だけ記述する必要があります。

カンマで区切られた値のリストが続きます。

関連する問題