为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

firefox 9 doesn't handle the css font stack properly

  • 5 个回答
  • 28 人有此问题
  • 18 次查看
  • 最后回复者为 krakrjak

more options

The style body{font:13px/1.231 arial,helvetica,sans-serif;*font-size:small;*font:x-small} should cause the browser to work through the stack and use sans-serif if arial and helvetica are not available. This is how it worked in Firefox 8 and how it works in other browsers.

With Firefox 9 if the first font is unavailable it just substitues one of it's own instead.

If I remove arial and helvetica from the list then FF9 uses the system sans-serif as it should.

I would paste in some sample code, but this forum doesn't seem to support code snippets.

The style body{font:13px/1.231 arial,helvetica,sans-serif;*font-size:small;*font:x-small} should cause the browser to work through the stack and use sans-serif if arial and helvetica are not available. This is how it worked in Firefox 8 and how it works in other browsers. With Firefox 9 if the first font is unavailable it just substitues one of it's own instead. If I remove arial and helvetica from the list then FF9 uses the system sans-serif as it should. I would paste in some sample code, but this forum doesn't seem to support code snippets.

所有回复 (5)

more options

This is a HUGE deal. You've broken many sites internally that my company uses and that I maintain. This is a problem that affects all pages and breaks how CSS behaves. Here's a link to a site with a specific code example that shows off this bug: http://krakrjak.blogspot.com/2012/01/firefox-901-font-css-bug.html

Please fix this so I can quit answering questions about why our sites are broken in what appears to be the most popular browser at the company.

Thank you!

more options

No one from Mozilla has responded to this even though it continues to be a PITA. A bug has been opened on this issue at https://bugzilla.mozilla.org/show_bug.cgi?id=718016

If you are interested in getting this bug fixed please go to bugzilla.mozilla.org and vote for bug 718016.

more options

The css in the blogpost http://krakrjak.blogspot.com/2012/01/firefox-901-font-css-bug.html is wrong, and that is why this does not work in Firefox. To access a class you must use the class selector (a dot). For example: .p-inner p { }
You can go to Mozilla Developer Network to learn CSS.
https://developer.mozilla.org/en-US/learn/css

more options

I see what you mean. So using the # notation (id selector) instead of using the correct . notation (class selector) lead to this issue for me. It just appears that FireFox got a little more strict around the standard and that means the code I am maintaining is full of non-standard CSS that I will have to fix up now... ooh well.

Interestingly enough this worked up until 9.0. I do see that this is not valid CSS now. Thanks for the link.

There still seems to be an issue that Dan is tracking down that is separate from my misuse of CSS.

more options

I have updated the blog post to show what the issue with my CSS is and how to avoid the issue and write correct CSS in this respect.

http://krakrjak.blogspot.com/2012/01/firefox-901-font-css-bug.html

由krakrjak于修改