3 ms·
Css width is probably 320px on that too. Css pixels are not screen pixels.
by ehsanu1 6y ago
Css width is probably 320px on that too. Css pixels are not screen pixels.
- zelphirkalt 6y agoCan anyone explain this? Why are these pixels not the same as physical pixels, like I asume to be on a computer screen?
- ehsanu1 6y agohttps://webplatform.github.io/docs/tutorials/understanding-css-units/#So%E2%80%A6-a-pixel-is-not-a-pixel-and-an-inch-is-not-an-inch https://webplatform.github.io/docs/tutorials/understanding-c...?
- zelphirkalt 6y agoNo, I meant: Explain why pixels on smart phones are not physical pixels, as I would expect them to be. Why does a phone need to act differently, kind of dishonest about its pixels?
- ako 6y agoBecause it ensures a page is useable on a mobile phone, even if the author didn’t take mobile into account: the screen can accommodate for about as much information as a regular 320px computer screen. If you try to use every pixel as you would on a regular screen it would be illegible for most users.
- reificator 6y ago> Explain why pixels on smart phones are not physical pixels, as I would expect them to be. Why does a phone need to act differently, kind of dishonest about its pixels? The phone is not acting differently. The phone is acting according to the specification, which is that a pixel is 1/96th of an inch. This happens on all devices, not just phones. From the spec: > The absolute length units are fixed in relation to each other and anchored to some physical measurement. They are mainly useful when the output environment is known. The absolute units consist of the physical units (in, cm, mm, pt, pc, Q) and the visual angle unit (px): > 1in = 2.54cm = 96px https://developer.mozilla.org/en-US/docs/Glossary/CSS_pixel https://developer.mozilla.org/en-US/docs/Glossary/CSS_pixel https://drafts.csswg.org/css-values-3/#absolute-lengths https://drafts.csswg.org/css-values-3/#absolute-lengths
- reificator 6y agoBecause after a short lived attempt to educate uninterested web developers about px vs em vs.... browsers decided the easiest way forward was to give up and lie.