2015-10-06 31 views
0
@font-face { 
font-family: 'Snell Roundhand Script'; 
src: url('../fonts/snell-roundhand-script.eot'); 
src: url('../fonts/snell-roundhand-script.eot?#iefix') format('embedded-opentype'), url('../fonts/snell-roundhand-script.woff') format('woff'), url('../fonts/snell-roundhand-script.ttf') format('truetype'), url('../fonts/snell-roundhand-script.svg#Snell Roundhand Script') format('svg'); 
} 
@font-face { 
font-family: 'Baskerville Old Face'; 
src: url('../fonts/ufonts.com_baskerville-old-face.eot'); 
src: url('../fonts/ufonts.com_baskerville-old-face.eot?#iefix') format('embedded-opentype'), url('../fonts/ufonts.com_baskerville-old-face.woff') format('woff'), url('../fonts/ufonts.com_baskerville-old-face.ttf') format('truetype'), url('../fonts/ufonts.com_baskerville-old-face.svg#Baskerville Old Face') format('svg'); 
} 

上面的代碼是字體面對面代碼爲什麼我的字體沒有改變?

及I我poting的CSS我已經補充說:

.big-red-text{ 
color: #ff0000; 
font-family: Snell Roundhand Script; 
font-size: 50px; 
text-align: center; 
} 

.big-orange-text{ 
color: #ff6600; 
text-align: center; 
font-weight: 600; 
font-family: Baskerville Old Face; 

} 

有什麼在這個失蹤?爲什麼不考慮字體?所有字體都存儲在根目錄中的字體文件夾中。

+0

風格存儲在.css文件和緩存問題? – Amarnasan

回答

0

試試這個:

.big-red-text{ 
    color: #ff0000; 
    font-family: 'Snell Roundhand Script'; 
    font-size: 50px; 
    text-align: center; 
} 
+1

使用單引號將字體系列包裝起來並不起作用 –

2

如果您的字體名稱包含空格,你必須圈地它在單引號。 如果名稱中沒有空格,可能會丟失單引號,但我建議始終使用它們來避免錯誤。

因此,作爲Fundhor表明它會與

font-family: 'Snell Roundhand Script'; 

font-family: 'Baskerville Old Face'; 

工作,確保您的文件是在正確的地方:

- css 
-- fonts.css <-- here you are declaring your @font-face 
- fonts 
-- snell-roundhand-script.eot 
-- etc... 

另外包括你之前,你fonts.css正在使用font-family

+0

將字體系列包裝在單引號中並不能解決問題 –

+0

爲了便於調試,請嘗試使用不包含空格的名稱。 – Fundhor

+0

仍然沒有任何東西,我將它從斯內爾圓形腳本更改爲斯內爾和巴斯克維爾老臉巴斯克維爾相同 –

相關問題