1

我有一个 URL 为http://myapp.herokuapp.com/welcome.php的网站,我将域 www.example.com 作为 FRAME 重定向到该 PHP 页面。当我尝试从 IE9 加载 www.example.com 时,我收到此错误:

CSS3111: @font-face encountered unknown error. abeatbyKai.TTF

该字体放在这里: http: //myapp.herokuapp.com/common/fonts/abeatbyKai.TTF

我的 CSS 文件是从 welcome.php 调用的,如下所示:

<link rel="stylesheet" href="css/iflikeu.welcome.0.1.css" type="text/css" />

这是我的 CSS 代码:

@font-face {
    font-family: 'abeat';
    src: url(../common/fonts/abeatbyKai.TTF);
}

如果我输入src: url('http://myapp.herokuapp.com/common/fonts/abeatbyKai.TTF');仍然不起作用。

另一个例子:这张图片是从welcome.php中加载的,像这样

<a id="enLang" class="btn lang_flag" href="#" onclick="changeLanguage('userLangWelcome','en');"><img src="common/images/flags/en.png"/></a>

在 CSS 文件中,代码如下:

.lang_flag img {
    width: 25px;
    height: 12px;
    vertical-align: middle;
}

但是,不显示图像。只需按钮 ( btn)。

This error only occurs in IE when there is a FRAME redirection. If I load directly http://myapp.herokuapp.com/welcome.php from IE it works, and www.example.com from any other browser works as well.

Any ideas? Thanks

4

2 回答 2

3

IE doesn't allow fonts to be loaded from external domains by default. See this thread.

Maybe you need to actually set the Access-Control-Allow-Origin HTTP Header on the domain that contains the frame.

On a side note, if you are only using a frame because you want your heroku app to show on your own domain name, you should take a look at the Custom Domains Heroku article -- you could just point your domain name at your heroku app.

于 2012-11-04T14:35:02.970 回答
1

try this, IE is such a pain in the ass when it comes to anything:

@font-face {
font-family: 'FFFTusjBold';
src: url('FFF_Tusj-webfont.eot');
src: url('FFF_Tusj-webfont.eot?#iefix') format('embedded-opentype'),
     url('FFF_Tusj-webfont.woff') format('woff'),
     url('FFF_Tusj-webfont.ttf') format('truetype'),
     url('FFF_Tusj-webfont.svg#FFFTusjBold') format('svg');
font-weight: normal;
font-style: normal;

}
<!--[if IE]>
font-family: 'FFFTusjBold';
src: url('FFF_Tusj-webfont.eot');
url('FFF_Tusj-webfont.eot?#iefix') format('opentype');
}
-->
于 2012-11-10T19:10:05.327 回答