2013-12-18 54 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

相关问题