The Problem With Em-Based Layouts

I was recently working on a project and thought it might be interesting to try out an em-based layout (where the layout of the entire site changes based on the font size.) I was hoping to preserve ideal line-length for my copy. The geek cred associated with em-based layouts was also appealing–earlier this year it seemed like they were all the rage. This trend may have been kicked off by the brilliant Mr. Dan Cederholm, a personally hero of mine in the web development community–as silly as that may sound.

It occurred to me, however, that there’s a fundamental flaw in the logic of an em-based layout. As a visitor increases the size of the text on screen, the layout will increase in width so that everything remains in proportion. Now I’m generalizing here, but if a visitor needs to bump up the text size to read it, it’s possible (perhaps even likely) that they could be older and potentially less technical than us web developers with our 20+ inch monitors. As the text size (and therefore layout width) increases, these users with their smaller monitors will run out of room to grow pretty quickly. This causes dreaded horizontal scrolling which no one likes, no matter what designers may have told you in the late 90s.

Roger Johansson acknowledged this flaw on his blog and suggested that by setting a maximum width in pixels you could prevent this issue. The problem that is titular to this post, though, is that this just doesn’t seem to work. It’s possible that it did work at one time, but I’ve tested many layouts online in addition to my own test case and found that in recent versions of Firefox the layout expands unchecked, causing horizontal scrolling. Perhaps this feature was broken during recent updates to Mozilla’s rendering engine. Unless I’m missing something em-based layouts are self-defeating as it stands. So are they anything more than geek-chic?

Dustin Tigner points out in the comments that something has changed in firefox 3. It now uses page zooming by default. If you enable text-only zooming these layouts start to work again. That begs the question, however: With browsers moving toward page zooming by default, how much longer will em-based layouts be a practical use of our time? I think in some cases page zooming provides a worse user experience than a well-coded em based layout (see as an example,) and as a default it tends to override those careful layout considerations.

Happily Hosted With Dreamhost

If there were such a thing as a regular reader of this site, he or she might notice that I’ve added a little blurb about my web host to the bottom of my sidebar. I’ll be up front in saying that It includes my affiliate link so that if anyone signs up through my site I’ll save a bit of money on hosting. That person will also save a bit of money on his/her hosting.

For a long time I left my affiliate link off the site. I was concerned about promoting a product that people were having trouble with (I’m sure searching Google for “Dreamhost Downtime” will yield ample evidence.) However, Dreamhost has been so reliable for me and for such a long time now, that I’m ready to shout their praises from the rooftops, so to speak. They also have the easiest-to-use control panel I’ve ever encountered at a web host, which is a nice bit of icing on the cake. So go forth and and take advantage of their value-priced hosting with excellent features, and feel free to use my affiliate link if you’d like to save yourself a bit of money. I think you’ll be pleasantly surprised.