Fonts Chrome上HTTPS页面上的谷歌网页字体

Fonts Chrome上HTTPS页面上的谷歌网页字体,fonts,https,Fonts,Https,我在做一个ecommmerce项目。默认情况下,站点的某些部分是HTTP。其他页面(如签出页面)默认为HTTPS。在HTTPS页面上,我在Chrome上的控制台上收到以下消息: [blocked] The page at https://store-ws3q9h.mybigcommerce.com/checkout.php?tk=c99fa39e007db6376dcddaac68695c22 ran insecure content from http://fonts.googleapis.c

我在做一个ecommmerce项目。默认情况下,站点的某些部分是HTTP。其他页面(如签出页面)默认为HTTPS。在HTTPS页面上,我在Chrome上的控制台上收到以下消息:

[blocked] The page at https://store-ws3q9h.mybigcommerce.com/checkout.php?tk=c99fa39e007db6376dcddaac68695c22 ran insecure content from http://fonts.googleapis.com/css?family=PT+Sans. 
[blocked] The page at https://store-ws3q9h.mybigcommerce.com/checkout.php?tk=c99fa39e007db6376dcddaac68695c22 ran insecure content from http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700.
[blocked] The page at https://store-ws3q9h.mybigcommerce.com/checkout.php?tk=c99fa39e007db6376dcddaac68695c22 ran insecure content from http://fonts.googleapis.com/css?family=Patua+One.
字体在文档头上的链接方式如下:

<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Patua+One' rel='stylesheet' type='text/css'>


到目前为止,它在我测试过的其他浏览器上看起来还不错

创建与架构无关的url

更改<代码>http://fonts.google...到
//font.google…

从前面放下
http:
https:
,浏览器将使用您当前在站点上使用的模式

您可以使用
https
http
请求资源,但不能从另一方请求资源 正好相反。上述解决方案(可能是最佳实践)的另一种选择是始终使用
https
如果可用(如果使用此样式,则必须是 当然是链接,否则就没有意义了)


从URL中删除协议并由浏览器确定:

<link href="//fonts.googleapis.com/css?family=PT+Sans" ...