简体   繁体   English

特定字体未显示在Google Chrome上,但Safari可以

[英]Specific font not showing on Google Chrome but Safari can

I noticed I couldn't find the magnifier icon in computed panel of Chrome inspector at the day before yesterfay. 我注意到,在昨天之前,我无法在Chrome检查器的计算机面板中找到放大镜图标 Everything looks fine before that and fonts also can display on the browser normally. 在此之前,一切看起来都不错,字体也可以正常显示在浏览器中。
What's going on with Google Chrome? Google Chrome发生了什么事?

On chrome 镀铬
铬

On safari 在野生动物园
苹果浏览器

Same css code but they are displayed with different fonts, one is "lanting hei" (on safari, right one), another is "Helvetica neue" (on chorme, wrong one) 相同的css代码,但是它们以不同的字体显示,一种是“ lanting hei” (在Safari上,右一种),另一种是“ Helvetica neue” (在chorme上,错误的一种)

You might not including ttf and woff font files. 您可能不包括ttf和woff字体文件。 Try as described below- 请按照以下说明尝试-

@font-face {
    font-family: 'your-font-name';
    font-style: normal;
    font-weight: 400;
    src: url("/css/fonts/your-font-name.woff") format("woff");
 }

or you share your code first. 或者您先共享代码。

The issue is that you have this in your css 问题是您的CSS中有这个

body{font-family: 'lanting hei';}

The font name the browser is looking for is 'lanting hei' instead of lanting hei (the difference being the quotes) 浏览器正在寻找的字体名称是'lanting hei'而不是lanting hei (区别是引号)

Change the css to 将CSS更改为

body{font-family: lanting hei;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM