XML technologies / CSS / Advanced websites with CSS / Using fonts with CSS / The font-size property / Differences between browsers and platforms
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
Browser and system incompatibilities are especially serious for font sizes. The following figure shows how differently the same rule renders across browsers and platforms.
Figure: Browser differences in absolute font sizes.
No two pages look alike. Considering what happens when users change their browser preferences raises the question of whether consistent font design is possible at all.
The short answer is no, unless we abandon HTML and display all text as images or Adobe PDF files. (Note: exact pixel font sizes are still preferable to these workarounds, avoiding browser differences. Make pixel-sized text large enough, however, to avoid problems with high resolutions or small displays such as subnotebooks.) We must accept that many users will always see our pages differently from our own browser.
We can at least limit the damage. First, always use stylesheets for fonts instead of the obsolete HTML tag <font>. CSS offers a possible solution: the W3C has long worked to standardize CSS property rendering across platforms. Newer browsers do show convergence. What is impossible today may work tomorrow, and our pages should be ready—with CSS.
Second, use alternative and relative font values wherever possible, leaving room for rendering differences. A web designer’s goal is the best compromise between flexibility and appearance, rather than a perfect design in isolation.
Avoid pixel font sizes!
Pixel font sizes produce fairly consistent results across browsers. Unfortunately, Internet Explorer users cannot resize them, an obvious accessibility problem. You may like small text and read it easily, but users with impaired vision must be able to enlarge it enough for comfort. Choose another sizing method that lets users adapt text to their needs.
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg