Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's only true on (most) mobile devices. px is still 1 pixel on Desktop with 100% system UI zoom (e.g. non-hidpi monitors).


It's still 1/96th of an inch in those cases, that's what is meant by "regardless how many actual pixels that ends up being".


If you change system UI zoom setting then the 1 pixel size in the browser change with zoom. At 200% web 1px is actual 2px. I am not sure how it could be "1/96th of an inch" when it can change size depend on the system setting.


1/96th an inch based on what the browser/system report the pixel density to be. There is no man coming out of your computer with a ruler to verify the reported value, so you're free to use a scaling value that isn't true. Zooming the browser or changing the system scaling will change the reported size of the pixels to the renderer.

Don't take my word for it, it's how it's defined in the CSS spec: https://www.w3.org/TR/css-values-3/#absolute-lengths


I know that is how its defined in the spec. But your original comment imply that it's literally 1/96 of an inch everywhere regardless of the device.


¯\_(ツ)_/¯, to the browser - it is. It is a good note to point out the browser may not have an accurate sizing of the display and would produce incorrectly sized outputs in those cases, but it doesn't change how px sizing works.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: