简体   繁体   English

Chrome浏览器未使用我的网页中定义的“ Open Sans”字体,而是为网站使用默认字体

[英]Chrome browser is not using 'Open Sans' font defined in my web page instead it is using default for a website

I have included font link in my every .html file of website 我在网站的每个.html文件中都包含了字体链接

and defined in CSS to use : 并在CSS中定义使用:

font-family: 'Open Sans', sans-serif; 字体家族:“ Open Sans”,sans-serif;

And it is working fine on firefox but in chrome, it is not picking up this font even after mentioning explicitly in my .html page. 而且它在Firefox上运行良好,但在chrome中,即使在我的.html页面中明确提及后,也没有选择该字体。

In Chrome, we have to change font type from settings manually. 在Chrome浏览器中,我们必须手动更改设置的字体类型。 So I am looking a way to force Chrome to use the font type which is mention in my website rater using its own. 因此,我正在寻找一种方法来强制Chrome使用我的网站评分器中使用的字体类型。

Please provide me any code line and explanation to achieve this. 请提供任何代码行和说明以实现此目的。

Here is my code : 这是我的代码:

 <!DOCTYPE html> <html> <head> <title></title> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700" rel="stylesheet"> <style type="text/css" media="screen"> p{ font-family: 'Open Sans', sans-serif; } </style> </head> <body> <p>This is Simple text to identify if font-family Open Sans is shown by chrome or not. This is Simple text to identify if font-family Open Sans is shown by chrome or not. This is Simple text to identify if font-family Open Sans is shown by chrome or not. This is Simple text to identify if font-family Open Sans is shown by chrome or not. This is Simple text to identify if font-family Open Sans is shown by chrome or not. This is Simple text to identify if font-family Open Sans is shown by chrome or not.</p> </body> </html> 

you can also see this on Click this link on chrome to see this live 您也可以在Chrome点击此链接查看此直播

welcome on Stackoverflow. 欢迎使用Stackoverflow。

If you look the href of the stylesheet you included the Muli font, ..?family=Muli in order to use the Open Sans you should include the it, replace it with ?family=Open+Sans 如果查看样式表的href,则包含Muli字体..?family=Muli以便使用Open Sans,则应包括它,并用?family=Open+Sans替换?family=Open+Sans

我认为您的链接参考很糟糕,选择字体时我有另一件事:

<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">

我以为,真正的原因是我禁用了Chrome安全性插件Pri *** Ba ****,现在我也可以在实时网络上看到Open Sans。

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

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