未捕获的引用错误:WebFont 未定义

ced*_*erd 5 javascript webfonts google-search-console

我正在测试页面是否适合移动设备问题 我正在使页面适合移动设备,但搜索控制台出现错误。我不知道为什么?

未捕获的引用错误:WebFont 未定义

当我单击“查看详细信息”测试页面时,我收到此错误,因为它显示了一些页面加载问题。我不明白这意味着什么?

小智 -2

我遇到了类似的问题,我使用以下方法解决了嵌入字体的问题:

<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
Run Code Online (Sandbox Code Playgroud)

另外,根据您的字体优先级异步加载 CSS 也很重要。

例如 Webfont Lora 400

<link href="https://fonts.googleapis.com/css?family=Lora:400&display=swap" rel="stylesheet" media="print" onload="if(media!='all') media='all'">
Run Code Online (Sandbox Code Playgroud)