ScotConnect

Why not use pixels?

Pixels as a units of measurement is in a kind of half-way-house between being a absolute unit and a relative unit of measurement.

Pixels are an absolute unit of measurement in the sense that if you set your text to 12px it will always be 12px, no matter what changes you make in your browser preferences. The physical size of that 12px character will however vary according to the resolution of the screen; on a low resolution screen the 12px character will look bigger than it does on a high resolution screen of the same physical dimensions.

This is because, the higher the screen resolution the more pixels there are crammed into each bit of screen real estate - with the 12 pixels, used to make up a character, crammed in to a smaller physical space. In this sense, it could be argued that pixels are a relative unit of measurement - relative to the screen resolution.

So should you be using pixels to set the size of your text?

'Give me pixels or give me death' said Jeffrey Zeldman in his article exploring the pros and cost of specifying text sizes on the web. He advocates the use of pixels as the best solution, on the grounds that it is the most consistent performer - from a designers point of view - across the main hardware platforms and browsers.

He does concede that setting text sizes in pixels will make it impossible to resize text on many current and past web browsers; specifically IE5 and below on Windows and prior to IE5 on Mac. And he also notes that on Linux, unless the end user has the font installed on their machines that is specified in the style sheet, the text may be very poorly displayed and may be illegible.

But he considers these disadvantages against those of using other units, and settles upon pixels as the best of a bad bunch. However as we are primarily concerned with accessibility, we cannot ignore these problems.

Em units he dismisses because they are ignored by Netscape 4 and because IE 3 treats em units as pixels (i.e. 2em headings will be rendered as 2 pixels high) - a star performer among CSS browser bugs.

Netscape, ignoring the CSS declaration, is not an accessibility problem, and as for the IE3 problem, there are workarounds related to how the style sheet is referenced from within the page. The most important problem with em units - and which is definately an accessibility problem - is that for IE uses who have their default text size set to 'smallest' - text can be too small to be legible if specified at a size lower than 1em.

However - even if we approach the options open to us from a purely Utilitarian point of view - less people will be disadvantaged if you use em units than if you used pixels; less people are using IE3 than are using IE 4, IE 5 for Windows, and Netscape 4 on both Mac and PC.

From the point of view of accessibility, the problems associated with using pixels are more serious than those encountered by using the relative em unit. Using em units does not - unlike pixels on the majority of web browsers - prevent the end user from resizing the text to suit their own needs.

Index | Next: What relative unit is best?


Free weekly accessible web design tip

Register for your weekly accessible web design tip 
Email: