css - 完全奇怪的 Firefox CSS 错误

标签 css firefox fonts

我做前端开发很久了,从来没遇到过这样的bug...

将以下 HTML 保存到文件中并在 Firefox 中查看(我的是 3.6.3):

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <style type="text/css">
    body { font-family: Helvetica, Sans-Serif;}
    h2 {font-weight: normal;}
    </style>
</head>
<body>
     <h2>Some normal text <strong>some bold text</strong> weird huh?</h2>
</body>
</html>

如果你不想试一试,输出就像你的猫在字符映射打开时走过你的键盘,除了 strong 标签。

我觉得这可能是字体问题?当我摆脱 font-weight: normal 它会恢复正常,但我不希望我的 h2 中的所有内容都加粗......任何人都有任何想法?更重要的是,有人能够重现这个吗??

谢谢。

编辑

这是一个 screenshot .它在所有其他浏览器中工作正常,并且之前未设置为粗体(普通文本)的所有文本都可以正常呈现。

最佳答案

这似乎是 Helvetica 特有的东西。这里有一些报告,其中的屏幕截图与您的情况完全一样。

他们提到了解决方法。在服务器端:

  • if the CSS definition defines the font family using font: instead of font-family:, this bug does not occur.
  • when setting the font-family by way of font-family: (instead of by font:), the error only occurs once you're showing fonts over 20pixels in size. It doesn't matter if the font size is set by way of em or px, but once the actual display size is over 20px, it gets garbled.

在客户端,似乎建议删除或重新安装 Helvetica 字体。您可以检查您的字体文件夹中是否有任何 HELVETIC.TTF 或类似文件?

关于css - 完全奇怪的 Firefox CSS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2650038/

相关文章:

css - 为什么 -moz-binding 在我的代码中不起作用?

html - 如何在英文网站上显示外语文字?

ios - 属性检查器中的字体按钮坏了?

Jquery 可排序拖放不显示 'move' 光标

html - CSS悬停菜单不起作用

css - 谷歌日历在 Firefox 中为周末着色

html - 用于慢速互联网连接的 Light/Easy weight 字体 CSS

html - Mozilla 无法识别显示 :inline-block inside display:table-cell container

asp.net - 如何从代码隐藏更改 CSS 类?

html - 在不影响移动 IE10 的情况下隐藏 Firefox 中响应式设计 View 的滚动条?