html - 特定网页在 Firefox 上呈现的字体不同

标签 html css google-chrome firefox google-fonts

我正在为一个网站开发登陆页面:

https://emotional-wellbeing.com/

该页面在 Chrome 中呈现良好,但在 Firefox 中根本不显示 Open Sans Condensed 字体。我已尝试从该论坛进行多项更改,但均无济于事。

Google 字体包括:

<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Open+Sans+Condensed:700" as="style" onload="this.rel='stylesheet'"/>

页面为Open Sans字体,除了:

<div class="sectionmainheadline"><h1 style="font-family: 'Open Sans Condensed', sans-serif; font-weight:700; font-stretch: condensed;">"Discover How You Can <span style='color: #3a9921;'>Melt Away</span> Away Your Stress & <span style='color: #3a9921;'>Overcome </span>Your Anxiety,<br/><span class='underline'>In As Little As 5 Minutes From Now</span>"</h1></div>

我正在使用 Bootstrap 4。

您可以在此处查看它在 Chrome 上的外观:

Chrome version

但在 Firefox 上,红色圈出的区域看起来不是 Open Sans Italic,而蓝色圈出的区域是天知道是什么字体!:

Firefox version

如何让这些带圆圈的区域看起来像 Chrome 版本?我没主意了。

最佳答案

看起来像这样

 <link rel="preload" […] as="style" onload="this.rel='stylesheet'"/>

一开始在 FF 中并没有像预期的那样工作。一旦我在检查器中手动将 rel 更改为 stylesheet ,提到​​的部分就会以所需的字体正常显示。

因为在此之前我什至没有看到对样式表 URL 的请求,所以我假设这里出现问题的不是 onload 部分,而是 FF 不想预加载样式表这种方式一般呢(?)。

关于html - 特定网页在 Firefox 上呈现的字体不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50796172/

相关文章:

php - 未选中POST PHP时,复选框未保存

c# - 必填字段验证器文本定位

html - 使元素在元素内部,位置粘在其他粘性元素之上

google-chrome - 如何将 *.rhcloud.com 导入 Chrome(ium)?

javascript - 切换 jQuery 中的当前元素

html - CSS div 不听我的最大宽度属性

css - 去除 CSS 圆 Angular 光环的最佳方法?

jquery - 将 css 规则添加到 iframe 主体

google-chrome - 仅适用于移动屏幕的 Windows 机器上的 chrome 中出现仅在下拉菜单后面的黑框?

javascript - 突出显示浏览器(Chrome)中的文本功能,看起来像在 android 中突出显示