Etsi tuesta

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Lue lisää

firefox 9 doesn't handle the css font stack properly

  • 5 vastausta
  • 28 henkilöllä on sama ongelma
  • 18 näyttöä
  • Viimeisin kirjoittaja 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.

Kaikki vastaukset (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

Muokattu , muokkaaja krakrjak