C
C
cicatrix2018-02-08 12:50:38
Layout
cicatrix, 2018-02-08 12:50:38

How to display div true (by ruler) width strictly 100mm?

Don't rush to answer.
The bottom line is this: if you just write: it will, of course, be displayed, but I need true 100 mm (that is, if you attach a ruler to the screen, the block width would be exactly 100 mm). Is it possible to somehow determine the dpi of the user's screen and calculate the number of pixels in true 100mm? <div style="width:100mm"></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Olga Veter, 2018-02-08
@vetero4eg

Google it, maybe something like that will help.
https://stackoverflow.com/questions/17969/how-to-access-screen-dis...
You're less likely to be helped by using media queries with pixel density and resolution.. something like that.
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 700px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width : 700px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 700px),
only screen and ( min-device-pixel-ratio: 2) and (min- width: 700px),
only screen and ( min-resolution: 192dpi) and (min-width: 700px),
only screen and ( min-resolution: 2dppx) and (min-width: 700px) {

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question