Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Fonts and web2py

Tags:

css

fonts

web2py

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.

like image 609
thiago Avatar asked Aug 02 '26 04:08

thiago


1 Answers

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").

like image 68
Anthony Avatar answered Aug 05 '26 12:08

Anthony