Omi*_*mid 3 css css3 font-face
我font-face在我的localhost上使用CSS3 属性,并在我的网站上托管了一个字体,以便在本地网页上加载.它适用于IE和Chrome,但不适用于Firefox.奇怪的是,当我使用本地URL时,它也适用于Firefox.
//Works with local URLs like http://localhost/repo/BMitra/BMitra.*
@font-face {
font-family: "BMitra";
src: url("http://fonts.gexek.com/repo/BMitra/BMitra.eot");
src: local("?"),
url("http://fonts.gexek.com/repo/BMitra/BMitra.woff") format("woff"),
url("http://fonts.gexek.com/repo/BMitra/BMitra.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
我认为在本地主机上工作可能是问题,但我发现Google字体也在本地主机上正常工作.
您可以在Firefox和(Chrome OR IE)浏览器上看到这个小提琴来演示我的意思.
http://jsfiddle.net/66QE3/1/
我错过了什么?
Firefox错误控制台说:
downloadable font: download failed (font-family: "BMitra" style:normal
weight:normal stretch:normal src index:1): bad URI or cross-site access
not allowed
source: http://fonts.gexek.com/repo/BMitra/BMitra.woff
Run Code Online (Sandbox Code Playgroud)
要使用来自其他域的可下载字体,托管该字体的服务器应具有允许该字体的跨站点访问设置,请参阅HTTP访问控制(CORS).
| 归档时间: |
|
| 查看次数: |
4382 次 |
| 最近记录: |