【发布时间】:2019-07-20 11:50:23
【问题描述】:
我的本地空间中有字体,并尝试使用 css @font-face 更改我的 html 字体,它可以在除 Firefox 之外的任何浏览器上运行。这只是一个简单的 html 和 css 文件,我没有像 apache 这样的服务器。
我应该如何解决它?
@font-face {
font-family: 'iransans';
src: url('../fonts/IRANSansWeb.woff2') format('woff2'),
url('../fonts/IRANSansWeb.woff') format('woff'),
url('../fonts/IRANSansWeb.eot') format('embedded-opentype'),
url('../fonts/IRANSansWeb.ttf') format('truetype');
}
我收到了这个错误: 跨域请求被阻止:同源策略不允许读取位于 file:///P:/workspace/karAmuzi/karamuzi%20project%201/fonts/IRANSansWeb.woff2 的远程资源。 (原因:CORS 请求不是 http)。
【问题讨论】:
标签: html css firefox font-face