Re: Clarify length units in CSS

Tomas Carnecky wrote:
> 
> Using CSS pixels for layout is the most portable way. If I say I want 
> something to be 10px, I want it to always visually appear the same size,

If I specified 10px (and using px sizes is bad accessibility practice - 
character sizes and window sizes are the actual key units) I would 
expect it to be the size that resulted in a 10 pixel images occupying 
exactly one device pixel per image pixel on a 1999 (CSS vintage) desktop 
display.  I.E. the only sensible reason for pixel units is smooth 
integration of bitmap images, without sampling artifacts.

The reason for the more awkward definition is that this simple 
interpretation didn't, at the time, scale to printer device pixels, and 
these days doesn't scale to high resolution device pixels, or, without 
scrolling, to very low resolution device ones.  The definition was 
therefore generalised, so that, in the limit, as pixel size reduced to 
zero, pixels became equivalent to a percentage of the screen size. 
However, for non-trivial pixel sizes, it is subject to significant 
rounding, particularly in the range of resolutions used on displays.

If people are treating them as percentage of screen size at all 
resolutions, they miss the reason why they are called pixels, and being 
confused by their behaviour in the mathematical limit.

> regardless of whether the user uses a handheld device with a 5" screen 
> or sees the content on a 20 foot billboard. But unfortunately no UA 
> implements those units correctly.

You mean angular size.  However, that actually breaks down for small 
screens, as people don't normally view them with magnifying glasses, and 
especially as you reach middle age, you cannot focus in much closer than 
normal reading distance, even with reading glasses.

-- 
David Woolley
Emails are not formal business letters, whatever businesses may want.
RFC1855 says there should be an address here, but, in a world of spam,
that is no longer good advice, as archive address hiding may not work.

Received on Thursday, 24 July 2008 23:18:33 UTC