preloading font with rel preload

前端 未结 5 2048
予麋鹿
予麋鹿 2021-02-05 01:46

I am preloading a font using the HTML tag with the rel attribute set to preload as captured in the snippet below;

<         


        
5条回答
  •  不思量自难忘°
    2021-02-05 02:37

    Your preload-Tag takes the argument "crossorigin", which must be given for Webfonts, even if they are on the same host as your website.

    See https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content#Cross-origin_fetches or https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/#early-loading-of-fonts .

提交回复
热议问题