Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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
Javascript 渲染div后是否加载Google webfont?_Javascript_Html_Css_Fonts_Font Face - Fatal编程技术网

Javascript 渲染div后是否加载Google webfont?

Javascript 渲染div后是否加载Google webfont?,javascript,html,css,fonts,font-face,Javascript,Html,Css,Fonts,Font Face,可能重复: 我在html的头部添加了一个google webfont <link href='http://fonts.googleapis.com/css?family=Kite+One' rel='stylesheet' type='text/css'> 我在做什么: 我正在用一个div构建一个盒状结构(比如pinterest),其中包含一种字体的内容 然后像在pinterest一样排列盒子 字体加载缓慢: 在使用kite的css类之后,一种字体称为box load

可能重复:

我在html的头部添加了一个google webfont

<link href='http://fonts.googleapis.com/css?family=Kite+One' rel='stylesheet' type='text/css'>

我在做什么:

  • 我正在用一个div构建一个盒状结构(比如pinterest),其中包含一种字体的内容

  • 然后像在pinterest一样排列盒子

字体加载缓慢:

  • 在使用kite的css类之后,一种字体称为box load with backup font。然后,当一种字体替换备份字体时,框会调整折叠UI的大小。(这种情况仅在第一次加载字体时发生)

如果字体从谷歌加载缓慢,请尝试从谷歌下载,并在自己的网站上托管。

还可以在Chrome中使用开发者工具进行调查,然后点击网络。并查看实际花费的时间,这可能是其他原因导致加载缓慢,如果字体加载在慢项之后,则会显示字体太慢


如果字体加载缓慢,每次加载速度是否相同?您所在的网络以速度慢或限制著称吗?

谷歌页面加载在仪表上显示了什么?什么价值?@aspiring aqib:font/woff文件的kite one字体只有在调用带有font系列的css类时才能下载。下载woff文件需要7毫秒。但div似乎是在此之前构建的。好吧,你只需要7毫秒,但对于网速较慢的用户需要100毫秒!