简体   繁体   English

图标字体偶尔显示为正方形,并在悬停时返回图标

[英]Icon-font sporadically shows up as squares and back to icon on hover

Getting a weird behaviour for FontAwesome icon font. 获得FontAwesome图标字体的奇怪行为。

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. 将鼠标悬停在它们上方时,它们将恢复正常显示。

在此输入图像描述

I'm loading the font via CDN: 我正在通过CDN加载字体:

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

I guess white squares are from FontAwesome CSS, the browser having troubles to recognise the character: 我猜白色方块来自FontAwesome CSS,浏览器有识别字符的麻烦:

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

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? 可能与其他CSS冲突?

Need some suggestions where to look for a root cause. 需要一些建议在哪里寻找根本原因。

I was brought to your question, because we have been experiencing the same thing on our site with the Symbolicons icon font. 我被问到了,因为我们在网站上使用Symbolicons图标字体经历了同样的事情。

After doing some research I found out that this happens due to a bug in Chrome. 在做了一些研究后,我发现这是由于Chrome中的一个错误而发生的。 So the issue is not with Font Awesome and I don't think you can do anything for now to fix it. 所以问题不在于Font Awesome,我认为你现在无法做任何事情来修复它。 Guess we just have to wait for the fix to hit the stable Chrome version. 猜猜我们必须等待修复才能达到稳定的Chrome版本。

Links to the bug discussions: 错误讨论的链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM