2013-12-18 56 views
1

所以試圖添加一個自定義的@ font-face字體到我的asp.net項目。得到了它的Chrome瀏覽器的工作...@ font-face不適用於IE,但是適用於Chrome瀏覽器?

@font-face 
{ 
font-family: "Century Gothic"; 
src: url('GOTHIC.TTF'), 
} 

body { 
background-color: #fff; 
border-top: solid 10px #000; 
color: #333; 
font-size: .85em; 
font-family: "Century Gothic", Segoe UI, Verdana, Helvetica, Sans-Serif; 
margin: 0; 
padding: 0; 
} 

,但需要與其他人幫助......(這是我嘗試)...但不工作:

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

而且不知道我需要.eot,.woff等擴展名。我只加

GOTHIC.TTF 
GOTHICB.TTF 
GOTHICBI.TTF 
GOTHICI.TTF to my prjoect. 

從工作:

http://stackoverflow.com/questions/8115302/font-face-not-working-even-after-trying-everything-i-could-think-of?rq=1 

http://stackoverflow.com/questions/6238737/font-face-with-embedded-font-does-not-work?rq=1 

http://stackoverflow.com/questions/20659571/adding-a-custom-font-to-vs-2010-fontface 
+0

這是否有幫助:http://stackoverflow.com/questions/14287465/font-face-not-loaded/14287894#14287894 – 97ldave

回答

2

您需要的EOT,WOFF等文件擴展名 - IE678不支持TTF格式,只EOT

0

我認爲這個問題是因爲跨域使用字體。

因此,即使您看到域名引用系統的相同位置,啓動「http://stackoverflow.com/questions/8115302/font-face-not-working-even-after-trying-everything-i-could-think-of?rq=1」的URL也會被視爲與「http://www.stackoverflow.com/questions/8115302/font-face-not-working-even-after-trying-everything-i-could-think-of?rq=1」不在同一個域中。

你需要切換到相對URL擺脫問題

,你也可以檢查Cross domain workaround for @font-face and Firefox,這將幫助你。

+0

這不是問題的手邊 - 這是IE瀏覽器不是由於缺少對TTF字體類型的支持,因此顯示字體。 – Xarus

相關問題