Monday 15 July 2002

Out, damned pixels! out, I say!

The problem of making my text resizable has been hanging over me like upcoming exam. I know that sometime this week Mark Pilgrim is going to hand out a test paper containing just one problem:

Given that you will no longer be controlling the text size in your weblog with absolute font sizes (i.e. pixels), submit a style sheet that allows readers of your weblog to resize all the text in each of the major browsers.

Today I spent a few hours cribbing from every available online source (no names, no pack drill) and I think I may have settled on an idiosyncratic mix of ems and percentages that meets the requirements. No doubt we shall soon see how theory translates into practice.

Permalink | Technorati


I'd love to see how you finally do it. I've been struggling with the problem myself, and just haven't come up with a satisfactory solution.

Posted by John on 15 July 2002 (Comment Permalink)

Looks good to me so far. Your leading may have shrunk a bit, but the text looks fine.

Hint: Anything smaller than body text, use keyword xx-small. Body text and upwards, use ems based on 100%.

Posted by Dorothea Salo on 15 July 2002 (Comment Permalink)

As a frequent lurker of alt.html, I often read not to specify any font sizes at all, except for headings when really desired. I suggest if your efforts betray you, this is plan B then.
: )

Posted by Kris on 15 July 2002 (Comment Permalink)

Perhaps I should have made it clearer that this post is simply a heads up -- I wanted to be ready to switch to relative font sizing as soon as Mark Pilgrim gave the word. Currently, I'm still using pixels.

Kris, I don't like the idea of not specifying body text sizes one little bit. The end result almost always looks like a "See Spot Run" reading primer. Thanks for the pointer to the different font sizes page. It's great to be able to see all that at a glance.

Posted by Jonathon Delacour on 15 July 2002 (Comment Permalink)

Don't the absolute size keywords cause problems of their own, particularly with NS4?

I'm not sure about "xx-small", but "small" certainly has some cross-platform inconsistencies:

Posted by zem on 15 July 2002 (Comment Permalink)

"The end result almost always looks like a 'See Spot Run' reading primer."

Perhaps. The real pain may actually be the "letting go". : )

Posted by Kris on 15 July 2002 (Comment Permalink)

Yes, 'small' can cause problems, but for genuinely tiny font sizes 'xx-small' works better than anything I've tried.

Posted by Dorothea Salo on 15 July 2002 (Comment Permalink)

Why the obsession with tiny text?

Personally I set a minimum font size of not much less than my base size in my browser - bless you, Galeon authors! - and that seems to stop authors from insisting that Flyspeck Helvetica 3 is a sensible font choice.

I find that a font size explicitly set to 1.0em for the body element respects the user's setting in everything other than Unix NS4, and that font sizes larger or smaller than that can be specified in percentages or ems after that.

Posted by Andrew Chadwick on 16 July 2002 (Comment Permalink)

Well, I'm defining "tiny" here as "anything less than 12 px." I got no truck with Flyspeck Helvetica 3, and no more should anyone else.

Posted by Dorothea Salo on 16 July 2002 (Comment Permalink)

This discussion is now closed. My thanks to everyone who contributed.

© Copyright 2007 Jonathon Delacour