Sent by Ian Hickson on 18 September 2002 22:10
On Wed, 18 Sep 2002, [EMAIL-REMOVED] wrote:
> Ian Hickson wrote:
>>
>> Points are dependent on the user's screen resolution,
>
> Actually points have nothing to do with the screen. Points are to be
> used in print and print alone. The "theory" for points on the screen
> is that 1 pt = 1 px which entierly faulse. 1 pt only = 1 pt and
> points are only relevant in print.
A point is defined, per the spec, to be a fraction 1/72 of an inch. An
inch is not the same number of pixels on every display, that depends
on the resolution of the screen. On a 72dpi screen (like Macs claim to
be) an inch is 72 pixels, so a point is one pixel. On a 96dpi screen
(like most Windows-based computers claim to be) an inch is 96 pixels
and therefore one point is 96/72 pixels, which is roughly 1.33 pixels.
This is why 9pt text looks bigger on Windows than on Mac. (On Mac, 9pt
text is 9 pixels high, on Windows it is typically 12 pixels high.)
Some users have further configured their resolution; Windows users
using "large fonts" are at 120dpi, for instance, and X Windows System
users are often at pretty much arbitrary resolutions depending on the
default settings of their drivers.
So points are dependent on the user's screen resolution.
>> Pixels ignore the user's preferences
>
> Actually, again, no, this is incorrect. Some "Browsers" ignore the
> user preferernce when it comes to designs based on pixels.
Per the CSS spec, a pixel is a physical length which, on devices with
resolutions typical of screens (roughly speaking 50-150dpi) should
result in one logical pixel per physical pixel. However, the units are
defined such that on a printer (typically 300-2400dpi), one logical
pixel is a lot more than one physical pixel.
There are no user preferences to honour when it comes to pixels. Per
the spec, the font preferences control the size of the 'medium' font
size keyword, which is 1em on the root element.
Some browsers (IE is not one of them) have a font zoom mode, which
affects the size of all text, and which is an additional step after
the font size preferences.
>> 'em' units are relative to the font-size and are therefore much
>> friendlier for readers.
>
> yes, but relative to what?
On the root element, the 'em' unit is relative to the user's preferred
font size. On all other elements, the 'em' unit is relative to the
parent element's font size.
The 'em' unit has no relation to the resolution (dpi setting) of the
display device.
>> Percentages are relative to the parent element's width (generally)
>> and so typicaly scale with the window, which is also friendlier for
>> readers.
>
> "generally" is the keyword though.
Indeed; the percentage unit is relative to different things on
different properties. For example, on 'font-size' it is relative to
the parent font size, like 'em'; on 'top' it is relative to the height
of the containing block.
>> For font sizes, you could also use the keywords ('larger',
>> 'smaller', 'xx-large', 'medium', 'small', etc), which are relative
>> to the user's preferred font size.
>
> I have seen this method in action but the results are not always
> consistant cross-platform cross-browser.
Many browsers unfortunately have bugs in all these areas.
--
Ian Hickson )\._.,--....,'``. fL
"meow" /, _.. \ _\ ;`._ ,.
http://index.hixie.ch/ `._.-(,_..'--(,_..'`-.;.'