Load Google Font with <link> asynchronously or deferred without Font Face Observer

六月ゝ 毕业季﹏ 提交于 2019-11-30 10:52:12

Here ya go, include this in the body tag and not the head tag

<link href="https://fonts.googleapis.com/css?family=Noto+Serif" rel="stylesheet" lazyload>
Mirza Sisic

You can load the web fonts asynchronously with this script:

<script>
   WebFontConfig = {
      typekit: { id: 'xxxxxx' }
   };

   (function(d) {
      var wf = d.createElement('script'), s = d.scripts[0];
      wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
      wf.async = true;
      s.parentNode.insertBefore(wf, s);
   })(document);
</script>

You'll need this library, it's pretty easy to implement. I've learn this from a course I took recently, Responsive Web Design Fundamentals, if you're interested you can check it out here.

Only add block tag

 https://fonts.googleapis.com/css?family=Noto+Serif&display=block

Ref : Controlling Font

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