Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在何处放置Google字体代码<;头>;为了最大的效率?_Html_Css_Performance_Embed_Google Font Api - Fatal编程技术网

Html 在何处放置Google字体代码<;头>;为了最大的效率?

Html 在何处放置Google字体代码<;头>;为了最大的效率?,html,css,performance,embed,google-font-api,Html,Css,Performance,Embed,Google Font Api,在您的中,您将谷歌字体代码放在哪里以获得最大效率/最小页面加载时间?在其他样式表和脚本之前/之后?除了性能之外,还有其他考虑因素吗 <link href="https://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet"> 您可以将其放置在的底部,以获得更好的性能,在加载页面时字体可能会出现破损,但页面会显示得更快。只要字体在头部,无论它们在哪里,尽管您可以在标记中的其他脚本之前加载它们。您可以将其放在“styl

在您的
中,您将谷歌字体代码放在哪里以获得最大效率/最小页面加载时间?在其他样式表和脚本之前/之后?除了性能之外,还有其他考虑因素吗

<link href="https://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet">


您可以将其放置在
的底部,以获得更好的性能,在加载页面时字体可能会出现破损,但页面会显示得更快。

只要字体在头部,无论它们在哪里,尽管您可以在
标记中的其他脚本之前加载它们。您可以将其放在“style.css”文件的开头。只要它在头上就好!谢谢,但问题是是否有性能或其他影响。