Code Design Web

Px vs Em: Is it still relevant?

You used to have to choose. Choose between an easy, but inflexible, px-based layout or a hard to control, but flexible, em-based layout.

Now with full-page zoom being implemented (as default!) in Internet Explorer 7, Firefox 3 and Opera 9*, it’s a different story. Full-page zooming means your easy px-based layout will be fully flexible. Even more flexible than most em-based layouts in fact, as images will scale along too.

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

[update] I don’t think liquid layouts are relevant anymore either.

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

PS. This still leaves percentage-based layouts of course, but they maximise screen real estate. Which is very different from maximising readability (line-lengths and all that jazz). As far as I can see, %-based layouts are good for some web-apps (like gmail) but aren’t optimal for other uses.

3 replies on “Px vs Em: Is it still relevant?”

What about points? since 1 pixel is 15 twips, and 1 point 20 twips, a website layout designed in points will not show any rounding errors. Twips (twentieth of an inch point, first introduced by Adobe for Postscript printing) being the core rendering measurement in pc’s, from which all other measures are derived (and macs too i believe).

Well there goes a post I had in the pipeline.

So very true.

Essentially, I think a lot of purists (part of me included), will feel that EM based layouts is the way to go. Personally, I think I’ll go PX and % for most things in the future, but for styling paragraphs and headers, there’s still a place for EMs.

Hayo: Good call, although there are two limitations I’d see with points. First off, a pixel is more precise. Working in twips themselves would be brilliant though. Secondly, images (and videos, etc) will all be in pixels anyway, so keeping everything in the same unit makes everything easier to control.

Joen: No please write your post! You’ll have a (slightly) different way of looking at it, or at least writing about it. Plus, it’ll reach a far, far greater audience!

And yes, there is a place for em’s. In headings, paragraphs, like you said – basically everywhere you’re working with moving text around relative to other text. Those situations tend to be mostly vertical, come to think of it..

Comments are closed.