Home » Posts tagged "px"

CSS 裡,px 的定義並沒有保證線性...?

在 Hacker News 上看到的舊文章,在「IN CSS, “PX” IS NOT AN ANGULAR MEASUREMENT AND IT IS NOT NON-LINEAR」這篇文章裡面,標題就直接提到「pixel 並非生而平等」...

文章裡的 pixel 的定義是:

a pixel is defined as the smallest object that can be displayed on a device

但我找不到這句話的出處...

到是 CSS 2.1 的 PDF 裡可以看到 px 的定義是:

px: pixel units — 1px is equal to 0.75pt.

以及 pt 的定義:

pt: points — the points used by CSS are equal to 1/72nd of 1in.

而連 in 都有定義:

in: inches — 1in is equal to 2.54cm.

然後 cm 這個縮寫定義到公制:

cm: centimeters

看起來不像是有問題啊?另外是還有對 reference pixel 的定義,看起來也很明確啊:

The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm’s length. For a nominal arm’s length of 28 inches, the visual angle is therefore about 0.0213 degrees. For reading at arm’s length, 1px thus corresponds to about 0.26 mm (1/96 inch).

暫時不考慮這個問題... 有機會再回頭來看好了 @_@

Archives