在CSS中将“mm”缩放为“像素” [英] Scale 'mm' to 'pixels' in CSS

查看:116
本文介绍了在CSS中将“mm”缩放为“像素”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个容器,每个测量都以'mm'定义,以用于打印目的。但是,我想在一个600px宽的块中展示它的预览,完美契合。将其缩小的最佳方法是什么?

I have a container with every measurement defined in 'mm' for printing purposes. However, I want to show its preview inside a 600px wide block with perfect fit. What would be the best way to scale it down?

推荐答案

毫米至像素以及反之亦然公式考虑了屏幕的

The millimiter to pixels and vice-versa formula takes the DPI of the screen into consideration.

DPI意味着每英寸点数。

毫米级像素没有真相除非你有一个稳定的DPI值,你可以使用。

There's no truth in mm to pixels unless you have a stable DPI value you can use.

无论如何,这是公式:


mm =(pixels * 25.4)/ dpi

mm = (pixels * 25.4) / dpi

最常见的DPI如果我没有弄错的话,看到的值是72和96,但由于这是用于打印,它很可能取决于打印机设置

The most-usual seen DPI values seen are 72 and 96 if I'm not mistaken, but since this is for print it will most likely depend on the printer settings

这篇关于在CSS中将“mm”缩放为“像素”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆