图标字体偶尔显示为正方形,回到悬停时的图标 [英] Icon-font sporadically shows up as squares and back to icon on hover

查看:610
本文介绍了图标字体偶尔显示为正方形,回到悬停时的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为FontAwesome图标字体获取一个奇怪的行为。

Getting a weird behaviour for FontAwesome icon font.

图标会在页面加载时显示,但是当我在标签页之间翻转并返回到图标可能会显示为白色方块(不是每个图标,只是一些)。将鼠标悬停在其上时,它们将恢复正常显示。

Icons do show up on a page load, but when I'm flipping between the tabs and going back to the original page, icons might appear as white squares (not every icon, just some). When hovering mouse over them, they are back to normal display.

我通过CDN加载字体:

I'm loading the font via CDN:

<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

我想白色方块是来自FontAwesome CSS,浏览器遇到麻烦识别字符:

I guess white squares are from FontAwesome CSS, the browser having troubles to recognise the character:

.fa-facebook:before {
  content: "\f09a";
}

我有点失落为什么它切换标签后继续发生。该字体似乎被加载,因为在第一次加载我可以看到的图标。可能它是与其他CSS的冲突?

I'm a bit lost why it is keep happening after switching tabs. The font seems to be loaded, as on the first load I can see the icons. Might it be a conflict with other CSS?

需要一些建议来寻找根本原因。

Need some suggestions where to look for a root cause.

推荐答案

我被带到你的问题,因为我们在我们的网站上经历了与Symbolicons图标字体相同的事情。

I was brought to your question, because we have been experiencing the same thing on our site with the Symbolicons icon font.

在做了一些研究后,我发现这发生由于Chrome中的错误。所以问题不是与字体Awesome,我不认为你现在可以做任何事情来解决它。

After doing some research I found out that this happens due to a bug in Chrome. So the issue is not with Font Awesome and I don't think you can do anything for now to fix it. Guess we just have to wait for the fix to hit the stable Chrome version.

链接到错误讨论:

  • Issue 336075: embedded fonts unload
  • Issue 336170: Wrong rendering of Webfonts when loading tabs in background

这篇关于图标字体偶尔显示为正方形,回到悬停时的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆