

CSS “px” is an Angular Measurement? - secoif
http://inamidst.com/stuff/notes/csspx

======
sanbor
Here I found a post where it says the posted link is wrong:
[http://omnicognate.wordpress.com/2013/01/07/in-css-px-is-
not...](http://omnicognate.wordpress.com/2013/01/07/in-css-px-is-not-an-
angular-measurement-and-it-is-not-non-linear/)

~~~
kamjam
And that article is in #1 spot in HN and of course, OP article itself is
linked in article!

~~~
smackfu
It's #1 now.

~~~
kamjam
Gah, FML and damn you Monday morning. I meant to say it IS IN #1. Corrected my
comment.

------
macspoofing
Yep. It's in the spec.

[http://www.w3.org/TR/CSS2/syndata.html#length-
units](http://www.w3.org/TR/CSS2/syndata.html#length-units)

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

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

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)."

So pixel units are intrinsically tied to dpi. Nobody cared when most monitors
were 72dpi/96dpi

~~~
gsnedders
People _did_ care. Monitors aren't everything. Printers are typically at least
300dpi, and printing that at 1:1 would result in minuscule text.

------
asg
While the headline is nominally true, I don't thing this discussion is
complete without talking about how browsers map this concept to actual device
pixels ... particularly since they don't know how far the user's eyes are from
the screen :)

~~~
voyou
Yes, particularly given that the spec explicitly says that for "lower-
resolution devices" (i.e., normal computer monitors) the px unit should "refer
to the whole number of device pixels that best approximates the reference
pixel." So it turns out the px unit has quite a lot to do with screen pixels.

------
gmjoe
While an interesting bit of trivia... this is completely pedantic.

To say that it is "doesn't really have anything to do with screen pixels,
despite the poorly chosen name" is just silly.

It's quite obvious that px means pixel, has everything to do with it, and that
the non-linear angular measurement is just a kind of more "formal" definition,
but which no browser has ever actually followed, or probably ever will.

~~~
falcolas
A 91 ppi pixel is nothing like a 300 ppi pixel, so this "pedantic" definition
matters. Particularly as retina-like displays become more and more common.

And whether they are doing it to the same accuracy as this article recommends
or not, browsers are not simply rendering 1px as one pixel width regardless of
the display resolution - My 2 year old iPad with a retina display demonstrates
this well.

------
jdmitch
> _No matter how large a value you put in for px, you 'll not be able to reach
> 180 degrees._

actually I only had to put in 10 9s to get 180...

------
code_duck
This article is approximately complete nonsense.

------
taeric
Hasn't this been true for a while?

------
badman_ting
Sure it does!

------
pearjuice
Suffering from the HN effect.

