There seems to be a discrepancy in how different browsers on Mac OS X 10.11.4 handle font-size. Is this an issue with Firefox, a CSS bug, or am I missing something about CSS?
Here's a JSFiddle where you can see the details. In a section like this:
<pre>Start of pre section
<code>**problem here!**</code>
End of pre section
</pre>
The style code { font-family: Courier; }
changes the font size displayed by Safari and Chrome, but not by Firefox. However, in other sections, the code
element increases from 13px to 16px in all browsers.
Why does the font size increase from 13px to 16px after setting the font-family
in all browsers?
It appears that while Firefox may be changing the font-family
, it is not adjusting the font-size
. Yet, it does change the font size in different contexts like within a p
element or a list.
I suppose the solution might involve explicitly defining font sizes using pixel units wherever necessary (even if it compromises accessibility).
Reference to a possibly related Firefox bug report from 2006: Bug 328621 - strange default monospace
font size -- differs from the proportional fonts
This inter-browser inconsistency seems quite troublesome. The last time I wanted my HTML markup to display monospaced parts consistently across Mozilla and M$IE, I had to resort to using absolute font sizes, despite their known accessibility issues.
While there are workarounds available by adjusting settings, most users tend to stick with defaults. :-(