在Chrome上@ font

编程入门 行业动态 更新时间:2024-10-28 20:17:36
Chrome上@ font-face阻止页面下载(@font-face blocking page download on Chrome)

我正在使用@ font-face,当我的@ font-face服务提供商关闭时,我的页面被阻止下载。 (所有请求都显着减慢到仅在请求font-face提供程序的.css文件时爬行,并且当服务提供程序的.css顺利加载时不会发生这种情况)

我读过的所有内容都表明,这只应该发生在IE中,并且只有在css调用之上有标记时才会发生。 但是,我在Webkit浏览器上遇到这个问题,我确信在任何脚本标记之前调用css文件。

还有其他人遇到过这个问题吗? 你知道是什么导致它或如何减轻它吗?

I am using @font-face and my page is being blocked from downloading when my @font-face service provider goes down. ( All requests significantly slow down to a crawl ONLY at the point that the font-face provider's .css file is being requested and this does not occur when the service provider's .css loads smoothly )

Everything I have read suggests that this should ONLY happen in IE and only when there is a tag above the css call. However, I am encountering this problem on Webkit browsers and I am being sure to call the css file prior to any script tags.

Has anyone else encountered this problem? Do you know what could be causing it or how to alleviate it?

最满意答案

对于任何碰到这个的人。 答案归结为浏览器如何解析和加载CSS。 浏览器将在呈现页面之前等待加载所有css。 由于css / font主机的服务器很慢,它阻止了我的页面呈现。

我的解决方案是通过一个比字体托管公司更可靠的cdn服务来托管字体。

For anybody running into this. The answer boils down to how CSS is parsed and loaded by browsers. Browsers will wait for all css to be loaded before rendering a page. Since the css/font host's servers were slow, it was blocking my page from rendering.

My solution was to host the fonts through a cdn service that was much more reliable than the font hosting company.

更多推荐

本文发布于:2023-07-08 04:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1072054.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Chrome   font

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!