【发布时间】:2025-12-24 11:00:11
【问题描述】:
我在“公共”文件夹中有字体文件夹。我在 css 文件中使用字体路径,例如:
https://example.com/fonts/icomoon.eot?2p5wfs
我遇到了这个问题:
from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
如果我打开我的 chrome "CORS" 扩展程序,它就可以工作。如何在不使用此 chrome 扩展程序的情况下加载图标?
【问题讨论】:
-
应该在为您的字体提供服务的服务器上启用 CORS。
标签: ruby-on-rails ruby fonts public