0

Recently, I was reading about the different types of pixels. I came across device pixels, CSS pixels, and device-independent pixels. I found out that device-independent pixels or dips can't be used on the web with HTML or CSS. That's fine. But now, I came across this answer here on StackOverflow saying that as of CSS 3, there are no values that are device-independent.

I've always thought that one CSS pixel is 1/96 inch, and nothing would change that. Seeing this answer now gets me confused, as I can't seem to understand his own explanation nor the explanation given in the w3 specs that he quoted. The spec can be found here.

I would love to have an in-depth explanation of what can make the value of one CSS pixel not be 1/96 inch. I'll also like to know if it's possible to use the dip(device-independent pixel) unit on the web in HTML, CSS, or JavaScript.

  • If CSS pixels had a fixed physical size, wouldn't that make them as useless for web design as device pixels? 1/96 inch may be visible in a smartphone located close to your face, but it's meaningless for the 10 metre display in your local shopping centre. – Álvaro González Jun 27 '22 at 10:49
  • Doesn't responsive web design not solve that. We can just change the pixel value depending on the width of the device, increasing or decreasing it as needed. But I think I'm beginning to get your point. The pixel value varies with viewing angle. – Abdulramon jemil Jun 28 '22 at 11:16
  • Can you explain better? – Abdulramon jemil Jun 28 '22 at 11:16

0 Answers0