Bulletproof @Font-Face 语法
P粉566048790
2023-09-05 18:47:35
<p>我尝试通过 FTP 安装字体,但出现 Bulletproof 字体语法错误的错误。请问我做错了什么?</p>
<p>编辑:我正在尝试在 Jared 的帮助下修复代码,但现在仍在工作</p>
<p>
<pre class="brush:css;toolbar:false;">@font-face {
font-family: 'Brasilero2018Free';
src:
local("Brasilero2018Free"),
url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.otf'),
url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.eot') format('embedded-opentype'),
url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.woff') format('woff'),
url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.svg') format('svg'),
url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.ttf') format('truetype');
}</pre>
</p>
<p>我想要的:安装没有错误的字体,并显示在 Elementor Editor 中</p>
您的语法为:
您只需在每一行中重新定义字体的 URL。所以浏览器只会使用最后一个,其他的都会被丢弃。正确的基本语法是:
如果您需要满足旧浏览器的要求,您可以包含额外的字体格式。
注意:将错误的
format('ttf')
更改为format('truetype')
,感谢 @herrstrietzel