3 ms·
At the beginning of CSS era one principal mistake was made - someone decided that 1px is a logical length unit that equals to 1/96 of inch. Attempt to reason th
by c-smile 10y ago
At the beginning of CSS era one principal mistake was made - someone decided that 1px is a logical length unit that equals to 1/96 of inch. Attempt to reason that was made here http://www.w3.org/TR/CSS21/syndata.html#length-units http://www.w3.org/TR/CSS21/syndata.html#length-units
Result of that particular decision is the mess we have with length units at the moment on the Web.
On monitor with physical 110 PPI resolution 1px is physically smaller than on "classic" 96 PPI monitor.
As a result no one can predict what will be the size of this:
div {
border: 1px solid;
width:100mm;
height:100mm;
}
everything but not 100mm square.
In Sciter Engine (https://sciter.com https://sciter.com) I've fixed this by applying three simple principles:
a) all logical length units are distances measured on device surface. Thus 100mm div rendered on screen will be 100mm when measured by the ruler put on monitor's surface. Same is while printing on paper.
b) 1px is always one device pixel - so we have hairlines for example. And so dimensions of bitmap images can be expressed with their natural resolution.
c) 1dip logical length unit (device independent pixel) was introduced for the convenience. 1dip == 1/96in - that is close to 1px in browsers.
Without all these using existing browsers for UI of desktop applications is quite questionable.
Even for mobiles ... main pointing device is a finger. It shall be the way to say: "this button shall is touchable by finger - so be precisely of 0.5in measured EXACTLY on screen surface".