[html5] Absolute Pixels in HTML 5

Sean B. Palmer sean at miscoranda.com
Mon May 25 09:24:15 PDT 2009


HTML 5 currently says that img/@width and so forth use CSS 2.1 pixel
values. Pixel values in CSS 2.1 are of course a relative rather than
an absolute unit. In other words, CSS px is a non-linear alias for
radians; 675.522px, for example, is a quarter of a radian.

But non-vector image formats like JPG and PNG have discrete pixels,
and screens have pixel displays with certain ppi values. So has
anybody looked at whether browsers actually implement px as a relative
unit? And how do they render images? I'm presuming that they don't
resample to fit the relative measurement.

>From the point of view of an author, I'm mainly concerned with, for
example, setting widths for figures. If I'm not giving any height or
width attributes for an <img> and my browser is rendering the image
absolutely, I don't then want to set a relative width for the figure.

-- 
Sean B. Palmer, http://inamidst.com/sbp/



More information about the Help mailing list