我在我的博主博客中使用自定义网络字体。它从几周前就不再工作了。我在 stackflow 网站上显示了针对此错误的解决方案,但我无法将其应用于 blogger 博客,因为 blogger 中没有 .htaccess 文件。请有人帮助我。我的字体代码在这里。我的网站是http://vishwatestblog.blogspot.com/
@font-face {
font-family: 'fmmalithix';
src: url('https://googledrive.com/host/0ByuGuHHrxa5GY0JSNTR4TUhaZ3c');
src: url('https://googledrive.com/host/0ByuGuHHrxa5GY0JSNTR4TUhaZ3c?#iefix') format('embedded-opentype'),
url('https://googledrive.com/host/0ByuGuHHrxa5GMm45RW5zWkd1Slk') format('woff2'),
url('https://googledrive.com/host/0ByuGuHHrxa5GUUJGS0dxME5XbDQ') format('woff'),
url('https://googledrive.com/host/0ByuGuHHrxa5GN2xhWmQ2bHdDRDA') format('truetype'),
url('https://googledrive.com/host/0ByuGuHHrxa5GRzhxSzRhN1dBTEE#fmmalithix') format('svg');
font-weight: normal;
font-style: normal;
}
最佳答案
看起来字体文件没有 CORS header ,这就是原因,您无法看到正在应用的字体。
此外,由于文件是从 googledrive 下载的,因此您需要登录才能访问该文件。
我不认为你可以在谷歌驱动器上托管字体文件并未经授权访问。
您可以自己检查一下,如果您以隐身模式打开,您提到的字体网址会抛出 404。
关于css - @font-face 在我的博主博客中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40188691/