CSS 快速字体 Web 字体在 chrome 或 IE 中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13342114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
fast fonts web font not working in chrome or ie
提问by Barry
I'm trying to use a font hosted on fast.fonts.com. I am using the following code to load the font:
我正在尝试使用 fast.fonts.com 上托管的字体。我正在使用以下代码加载字体:
<link type="text/css" rel="stylesheet" href="http://fast.fonts.com/cssapi/3566c147-3f45-41ed-941c-cfe1528c243e.css"/>
In Firefox the font loads correctly, but it is not working in IE or Chrome. Do these browsers require something extra to be set up in order to work?
在 Firefox 中,字体可以正确加载,但在 IE 或 Chrome 中不起作用。这些浏览器是否需要设置一些额外的东西才能工作?
It's being used on this site:
它正在本网站上使用:
http://d258eeb2b8434d14a1135347db13e724.cloudapp.net/Home.aspx
http://d258eeb2b8434d14a1135347db13e724.cloudapp.net/Home.aspx
回答by user323774
From the fonts.com FAQ - http://www.fonts.com/support/faq/web-fonts-work-only-in-firefox
来自 fonts.com 常见问题解答 - http://www.fonts.com/support/faq/web-fonts-work-only-in-firefox
Why Are My Web Fonts Only Displaying in Firefox?
为什么我的网页字体只能在 Firefox 中显示?
If the fonts are only working in Firefox, this may indicate that the domain listed in your Web font project are not permitted to receive the Web fonts. Review your project's domain list to ensure each domain has been specified properly. Also make sure that you've published your project since making any changes.
如果字体只能在 Firefox 中使用,这可能表明您的 Web 字体项目中列出的域不允许接收 Web 字体。查看项目的域列表以确保正确指定了每个域。还要确保您在进行任何更改后已发布您的项目。
回答by LorDex
Try to embed the font from fastfonts before your .css file declaration. I had the same problem with google fonts.
尝试在 .css 文件声明之前嵌入来自 fastfonts 的字体。我对谷歌字体有同样的问题。
回答by brian2013
Chrome by default blocks http request if you are on an https site. If you remove the "http:" from your href, now the style sheet will be loaded on either http or https matching the current protocol.
如果您在 https 站点上,Chrome 默认会阻止 http 请求。如果您从您的 href 中删除“http:”,则样式表将加载到与当前协议匹配的 http 或 https 上。
<link type="text/css" rel="stylesheet" href="//fast.fonts.com/cssapi/3566c147-3f45-41ed-941c-cfe1528c243e.css"/>