简体   繁体   English

字体没有出现在firefox中的iframe中

[英]fonts not showing up in iframe in firefox

I have page with an iframe. 我有一个iframe的页面。 Iframe content comes from other domain, but I have one css file that is included in head in that domain so both has same style, and it is. iframe内容来自其他域,但我有一个css文件包含在该域的head ,因此两者都具有相同的样式,并且它是。 except for headlines h1 with special font. 除了带有特殊字体的标题h1 It is shown properly in Chrome, Opera, IE and Safari, but not in Firefox :( It falls back to Arial. 它在Chrome,Opera,IE和Safari中正确显示,但在Firefox中没有显示:(它可以追溯到Arial。

@font-face {
     font-family: 'TheSansLight';
     src: url('ABSOLUTEPATH/fonts/TheSans_TT3_.eot?iefix') format('ie9-skip-eot'),
           url('ABSOLUTEPATH/fonts/TheSans_TT3_.woff') format('woff'),
           url('ABSOLUTEPATH/fonts/TheSans_TT3_.svg#TheSans_TT3_') format('svg');
}

and later in css 后来在css

font-family: "TheSansLight", Arial, Helvetica, Verdana, sans-serif;

Does enyone has any idea why firefox would not render font inside iframe? enyone有没有想过为什么firefox不会在iframe中呈现字体?

Firefox has a cross-domain policy for @font-face which blocks them unless specifically allowed on the remote host. Firefox具有@ font-face的跨域策略,除非在远程主机上特别允许,否则它会阻止它们。 Google turns up any number of tutorials for working around it with Apache config, such as this one: 谷歌通过Apache配置提供了任意数量的教程来解决它,例如:

http://www.cssbakery.com/2010/07/fixing-firefox-font-face-cross-domain_25.html http://www.cssbakery.com/2010/07/fixing-firefox-font-face-cross-domain_25.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM