[html5] Absolute Pixels in HTML 5
Geoffrey Sneddon
foolistbar at googlemail.com
Mon May 25 10:45:03 PDT 2009
On 25 May 2009, at 17:24, Sean B. Palmer wrote:
> 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.
What HTML 5 defines is what browsers currently do, but it's also true
that all desktop browsers set 1 CSS pixel = 1 physical pixel, so the
issue doesn't really come up, though the definition matches what
happens in cases where 1 CSS pixel does not equal 1 physical pixel.
--
Geoffrey Sneddon
<http://gsnedders.com/>
More information about the Help
mailing list