![]() |
The CSS InchCascading Style Sheets The Definitive Guide - Eric A. Meyer CSS 2.1 specification Lengths Now that would lead you to believe that inches here are always the good old inches we get on our rulers. But you would be wrong! The programmer has to turn ruler (absolute length) inches into pixels on a screen, as that’s where the results are gong to be displayed, so they have to determine how many pixels there are to a ruler inch on your screen, That’s right, your screen not theirs. How do they do that? - they don’t. The programmer does not know how many pixels make a ruler inch on your screen simply because there is no way they can accurately determine the physical size of your screen. So do they guess how many pixels to an inch? Of course not!
It’s as simple as that!! The CSS inch is a logical inch, not a physical inch. Look at this Eric Meyer page CSS2 Test Suite: 16.1 text-indent. The text says “The first line of this paragraph should be indented half an inch”. Should? Well either it is or it isn’t. The literally minded will put their ruler up to the screen, measure the indent, find it’s not half an inch, and explain that by burbling about inches being only a print metric1. That indent is not half a physical (ruler) inch but half a logical inch. So how many pixels is that indent, on that test page, on your screen?
Go on, count the number of pixels in that indent for yourself! There are any number of programs for counting screen pixels and Meazure is a free one. 1. Most applications let you change text size on screen by choosing a font size specified in points. For computers a point is 1/72 of an inch, so points are inches. When you can change the pixel size of text on screen by specifying its size in inches why would anyone think that inches are only for printing? Well they would if they didn’t understand the difference between paper (physical) inches and screen (logical) inches. |
| © 2006 - 2010 Richard Mason |