Accessible font sizes
A quick note to developers that are styling elements that use monospace fonts (pre, code, q, etc). Be aware that some browsers, like Safari and Chrome, have their own fixed-width font size preference, which by default is set to 13px. This upsets proceedings when you apply a proportional (% or em) font-size to the body.
There are three solutions to counter this problem:
- Apply font-size to each element separately
- Remove monospace from the font stack and treat it as a variable spaced font
- Use a fixed font size
Firefox and Internet Explorer have a single default font size so you can’t apply a larger size to monospace elements.
On the same subject, Google Chrome users can also set different default sizes for their serif and sans-serif fonts. By default these are identical so it will not affect the styling for the majority of users.