出于某种原因,我的谷歌字体没有出现在我的预览中!
我的 CSS 是这样的
@import url(http://fonts.googleapis.com/css?family=Montserrat:700,400);
html, body {
margin:0;
padding:0;
color:#2E3192;
font-family: 'Montserrat', sans-serif !important;
background-image: url("images/backgroundimg.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
font-size: 13pt;
overflow-x: hidden;
}
我很确定这一切都是正确的,因为它在 codepen 中工作。仅仅是因为我在预览还是什么?
谢谢
最佳答案
如果您的“预览”是 https,那就可以解释了。浏览器可能会阻止不安全的请求。尝试在不使用 http:
的情况下引用 Google 导入。
@import url(//fonts.googleapis.com/css?family=Montserrat:700,400);
以 //
开头的 URL 是协议(protocol)相关的。将使用父文档使用的任何协议(protocol)。
关于css - 谷歌字体没有出现(使用 cpanel),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30382221/