Google Fonts Font Doesn't load

不想你离开。 提交于 2019-12-01 19:07:10

Try to use URL without "http":

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

Few tips:
1. Use the HTML code in the beginning of your <head>, before anything else. Example:
<head> <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'> /* Rest of the code after this */ </head>
2. If that doesn't work, put this in your CSS file instead: @import url(http://fonts.googleapis.com/css?family=PT+Sans);

Ask yourself this:

1. Are you developing online or offline (if online check number 2)

2. Make sure your browser does not have a shield icon because this 
   means the browser is blocking the font and you need to click
   the allow button.

3. Check for spelling errors or anything suspicious.

4. Finally @import is the safest way I think. 

I had the same problem and if using the CSS tag of:

"font: 3em bold;" ---this overrides the google api call and loads your next default font.

SOLUTION: Use font-style and font-size

Check whether your css file is loaded after vendor stylesheets. For example, bootstrap.css should be before your css file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!