Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>How I can do it ?</p> </blockquote> <p><strike>You can't.</strike> Update: apparently, you can on many modern systems: Check out @Tomas's answer. It seems not to be always entirely reliable, though. </p> <p><strong>Old answer:</strong> You can't. Monitors display different numbers of pixels. The pixel size varies wildly from monitor to monitor. </p> <p>There are ways to interpolate the pixel size if you know the monitor size. This information is sometimes available to the operating system; however, it is impossible for a web site to get hold of this information. </p> <p>The only way to go would be to have the user do a calibration. For example, ask the user to hold an A4 piece of paper to the monitor, and use a draggable ruler to determine the area it covers. Using that information, you can then calculate how many pixels you will need to show 25 centimeters.</p> <p><strong>Update:</strong> @Tomas claims in his answer that using CSS <code>cm</code> values works on screen.</p> <p>This is in fact true on my Windows 7 and 23" Plug&amp;Play TFT Monitor (1920x1080 Pixels): <code>21cm</code> translates perfectly to the short side of a A4 sheet of paper in Chrome 7, IE6(!), IE7, Firefox 3.6.</p> <p>It doesn't seem to be entirely reliable, though: @Yi Jiang can't get it to work on a TFT using Ubuntu Linux; also, older Monitors may not send through their size information so it'll be impossible for the OS to determine a correct size. </p> <p>Here's a simple <a href="http://jsfiddle.net/8cUfM/3/" rel="noreferrer">JSFiddle</a> for testing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload