Google fonts not displaying (using cpanel)
for some reason my google fonts are not showing in my preview!
my css looks like this
@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;
}
I'm sure everything is correct as it worked in codepen. is it just because of the preview or something else?
thank
+3
source to share
1 answer
If your "preview" is https this will explain it. The browser can block unsafe requests. Try specifying google imports without http:
.
@import url(//fonts.googleapis.com/css?family=Montserrat:700,400);
A URL starting with //
is a relative protocol. Whichever protocol is used by the parent document.
+2
source to share