Is sizing fonts using "em" still relevant?

This article posted in "A List Apart" by Richard Rutter is still relevant,

How to Size Text in CSS http://www.alistapart.com/articles/howtosizetextincss/

If you look at the iterations, you'll see that,

Text size in pixels – iteration 1

The result is that Safari and Firefox still resize the text, whereas IE6 and IE7 do not. The text can be resized in Opera and IE7 by using the page zoom tool, which magnifies the page layout, text and images within.

Text size in ems – iteration 2

The results show that, across all browsers, text at the medium browser setting is rendered identically to text set in pixels. It also demonstrates that text sized in ems can be resized across all browsers. However IE6 and IE7 unacceptably exaggerate the smallness and largeness of the resized text.

Body sized as percentage – iteration 3

The results show that the difference between larger and smaller browser settings in IE6 and IE7 is now less pronounced, meaning we now have all browsers rendering text at an identical size on their medium setting, and resizing text consistently.

Setting line height in pixels – iteration 4

The results show that the 18px line-height is inherited by all text on the page....Unfortunately the results show that the 18px line-height is not scaled by IE6 and IE7 when text is resized, meaning the largest setting appears to squash the text.

Setting line height in ems – iteration 5

The results show accurate, consistently resized text and line-height across all browsers. Perfect. Or nearly so.

The Safari monospace problem – iteration 6

The results show consistently resized text and line-height across all browsers, including the monospaced text in Safari 2.

Even though this article is dated 2007, it's still very much relevant. Setting font sizes is more than just setting an em (or px).


Do not specify the font-size in absolute length units for screen stylesheets. They render inconsistently across platforms and can't be resized by the User Agent (e.g browser). Keep the usage of such units for styling on media with fixed and known physical properties (e.g print)

If you will use this method, no need to calculate

You can set the font-size of the body to 62.5%(that is 62.5% of the default of 16px), which equates to 10px, or 0.625EMs. Now you can set your font-size in EMs with an easy to remember conversion, divide the px by 10.

* 12px = 1.2EMs
* 13px = 1.3EMs
* 16px = 1.6EMs
* 8px = 0.8EMs
* etc…

This makes everything SUPER easy to remember and eliminates the need for conversion tables. Of course, you will still need to use a conversion table for nested elements when using EMs, if you are not being specific in your CSS, which is a whole separate issue.

But 76% is much better and you can use this to calculate http://pxtoem.com/

Yes it's still relevant:

IE6 is still widely used and is unable to resize the fonts defined in px. => Usability issues. That alone is a no-no.

and

IE 7 and 8 don't resize text sized with pixels either, actually. They do have page zoom, but some people prefer to incease text size only.

Here's a summary of what's good and bad about font sizing in general.

Font size in css http://easycaptures.com/fs/uploaded/213/2470522253.png

I personally like ems. Others, like Chris Coyier over at CSS-Tricks.com likes pixels. (Chris has an excellent article on the different font units).

It really comes down to personal preference.

Almost similar or related questions on SO

Should we still use em and % for defining the font-size of the website elements?

Is there really any point to using relative font sizing in CSS?

Why em instead of px?

Font size in CSS - % or em?

CSS font size: relative vs. absolute values. Which to use?

Problem with EM

Using relative instead of fixed size in CSS

Helpful online tool for px to em

http://pxtoem.com/

http://riddle.pl/emcalc/

http://convert-to.com/pixels-px-to-em-conversion.html

Convert entire site from px to em (This tool is still in development)

http://converter.elementagency.com/

EM Calculator AIR application (will work on all os)

http://jameswhittaker.com/journal/em-based-layouts-vertical-rhythm-calculator/

http://jameswhittaker.com/projects/apps/em-calculator-air-application/

Windows apps

http://www.thebrightlines.com/2009/11/16/pixem-pixel-to-em-converter/

http://www.storkas.com/Projects.aspx(go at bottom)

Pixels to Ems Conversion Table for CSS

http://jontangerine.com/silo/css/pixels-to-ems/

http://reeddesign.co.uk/test/points-pixels.html

emchart

http://aloestudios.com/tools/emchart/

http://aloestudios.com/code/emchart/

Some more articles on this issue

http://www.d.umn.edu/itss/support/Training/Online/webdesign/type.html


I have built full em zoomable sites in the past. In fact, every dimension in my company site ( http://kingdesk.com ) is em based. In all my recent work, I have abandoned such practice for four reasons:

  1. EM Maintenance is a b*tch. It is one thing to get the math right on nested elements during the initial design, but reorienting yourself after some time away is burdensome – to the point of just puting in fixed units at the expense of breaking the em-zooming effect.
  2. Browsers have come a long way in the past 2 years. The current version of every major browser supports page zooming natively.
  3. It is true that these sites are less accessible to visually impaired users in IE6, but there are abundant freely available tools for them that resolve this issue. If there is not a reasonable alternative, I have a moral obligation to facilitate their need. If there are 4 ADA accessible ramps to my front door, I'm not going to demo the steps and replace them with a 5th.
  4. I figure it saves me 20% in my design time.

I now design exclusively in fixed units, and have never once had a problem or complaint.

Oh, and if you're wondering, I no longer try to make sites look pixel perfect in IE6. They are still navigable, and decent looking. But time moves on and 9 year old browsers receive the attention they are due.

Tags:

Css

Browser