Candy, A Journal by a James

Px vs Em: Is it still relevant?

You used to have to choose. Choose between an easy, but inflex­ible, px-based lay­out or a hard to con­trol, but flex­ible, em-based layout.

Now with full-page zoom being imple­men­ted (as default!) in Internet Explorer 7, Firefox 3 and Opera 9*, it’s a dif­fer­ent story. Full-page zoom­ing means your easy px-based lay­out will be fully flex­ible. Even more flex­ible than most em-based lay­outs in fact, as images will scale along too.

So I’m ask­ing myself, why bother with hard-to-keep-from-breaking em-based layouts?

[update] I don’t think liquid lay­outs are rel­ev­ant any­more either.

[update 2] * And now Safari too! That’s all of the major browsers.

PS. This still leaves percentage-based lay­outs of course, but they max­im­ise screen real estate. Which is very dif­fer­ent from max­im­ising read­ab­il­ity (line-lengths and all that jazz). As far as I can see, %-based lay­outs are good for some web-apps (like gmail) but aren’t optimal for other uses.

3 Responses to “Px vs Em: Is it still relevant?”

  1. Hayo says:

    What about points? since 1 pixel is 15 twips, and 1 point 20 twips, a web­site lay­out designed in points will not show any round­ing errors. Twips (twen­ti­eth of an inch point, first intro­duced by Adobe for Postscript print­ing) being the core ren­der­ing meas­ure­ment in pc’s, from which all other meas­ures are derived (and macs too i believe).

  2. Joen says:

    Well there goes a post I had in the pipeline.

    So very true.

    Essentially, I think a lot of pur­ists (part of me included), will feel that EM based lay­outs is the way to go. Personally, I think I’ll go PX and % for most things in the future, but for styl­ing para­graphs and head­ers, there’s still a place for EMs.

  3. Hayo: Good call, although there are two lim­it­a­tions I’d see with points. First off, a pixel is more pre­cise. Working in twips them­selves would be bril­liant though. Secondly, images (and videos, etc) will all be in pixels any­way, so keep­ing everything in the same unit makes everything easier to control.

    Joen: No please write your post! You’ll have a (slightly) dif­fer­ent way of look­ing at it, or at least writ­ing about it. Plus, it’ll reach a far, far greater audience!

    And yes, there is a place for em’s. In head­ings, para­graphs, like you said — basic­ally every­where you’re work­ing with mov­ing text around rel­at­ive to other text. Those situ­ations tend to be mostly ver­tical, come to think of it..