3

I have this simple page:

<html>
<head>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Nunito">
<style>
#font {
  font-family: 'Nunito', sans-serif;
  font-size: 48px;
}
</style>
</head>
<body>
  <div id="font">Text here!</div>
</body>
</html>

It works pretty fine when I open the file in the browser, but when I put it online in static folder in web2py (on the PythonAnywhere), nothing changes, the font looks like simple Arial. So, what is wrong? Thanks in advance.

thiago
  • 49
  • 1
  • 6
  • Are you saying you are serving that entire HTML file as a static asset from web2py? What is the exact URL used to access the file? – Anthony Jul 15 '14 at 17:44
  • I just uploaded the file in the "static" folder. The url is my_username.pythonanywhere.com/app_name/static/file.html – thiago Jul 15 '14 at 18:06
  • Is the URL http or https? – Anthony Jul 16 '14 at 03:09
  • https and if I try to enter with http, the url always turns to https. – thiago Jul 16 '14 at 13:43
  • An interesting point: I just upload the same file on another server (orgfree) and everything seems okay, the page have the Nunito font. – thiago Jul 16 '14 at 13:54

1 Answers1

3

Try changing the CSS link to:

<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Nunito">

Removing the "http:" from the href will force the scheme to that of the parent page (in this case, "https").

Anthony
  • 25,466
  • 3
  • 28
  • 57