0

我在网页上使用谷歌字体,但字体是通过 http 调用的 -

    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

如果通过 https 请求页面 - 字体被识别为不安全的内容。

我如何请求

<link href='https://fonts.googleapis.com/css

仅当通过 https 连接请求页面时,才在请求 http 时提供 http 服务?

4

1 回答 1

2

删除http:which 将使 url 相对于当前方案

<link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
于 2013-10-09T14:32:44.747 回答