Wait for fonts to load before rendering web page

后端 未结 11 1362
终归单人心
终归单人心 2020-11-27 15:38

I\'m using @font-face to embed fonts in my website. First the text renders as the system default, and then (once the font file has loaded presumably) the correct font render

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 16:21

    (function() {
            document.getElementsByTagName("html")[0].setAttribute("class","wf-loading")
            document.getElementsByTagName("html")[0].setAttribute("className","wf-loading")
        })();
    

    use this method.. use with Webfont.js

提交回复
热议问题