![]() |
The CSS PixelWhen you have a display that has a high physical pixel density then a given number of pixels occupies less physical space on the screen than it would on a display with a low physical pixel density. Say we have a ‘normal’ pixel screen density and we draw a line 20 pixels wide. The software maps one drawing pixel to one device (screen) pixel so we get 20 device pixels illuminated. With a ‘high density’ pixel screen the device pixels are smaller and closer together so mapping one drawing pixel to one device pixel results in that 20 pixel line being a lot shorter. If the software maps one drawing pixel to, say, two device pixels then the line specified as 20 pixels long now illuminates 40 device pixels and, hopefully, the line looks to be about the right length. This is what the CSS 2.1 specification Lengths says about pixels.
A pixel that maps to one or more device pixels is called a ‘CSS pixel’, although the CSS specification doesn’t actually use that term. There is a lot of unanswered questions here:
Reference Pixel in the CSS SpecificationWhen I first saw the following section in the CSS specification I had to read it several times because I thought it might have been April 1st.
None of my screens have had a pixel density of 96 physical pixels per inch, as shown here in the Pixels per Inch column in the table They’ve just borrowed the Windows default value for screen dpi that exists solely for the purpose of translating inches to pixels, and is nothing to do with the pixel density of a display. Is there a NIST standard for reader’s arms? Perhaps browsers should allow users to store the length of their arms, or at least make them specify how far away from the screen they are sitting!! |
| © 2006 Richard Mason |