转换率pt,em,px,percent,other [英] Conversion rate of pt, em, px, percent, other

查看:174
本文介绍了转换率pt,em,px,percent,other的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

越来越少,我遇到的时候,我需要使用pt而不是px或em而不是pt,或任何情况下,并试图找到正确的大小,比大于36px有时更是一种痛苦在....比它应该。所以我基本上想让自己一个转换计算器。然而,我似乎找不到任何区别转换率是从一个到另一个的平等计数器部分的另一个。

More so than less I run into times when I need to use pt instead of px or em instead of pt, or whatever the case, and trying to find the right size for something bigger than say 36px is sometimes more of a pain in the .... than it should. So I basically want to make myself a little conversion calculator. However I can't seem to find anything that distinguishes what the conversion rate is from one to the other for an equal counter part of the other.

我希望我可以找到一个人在这里可以帮助我。基本上我的总体希望是使自己一个基于jquery的输入像计算器。我键入我的px,pt,%,其他和选择我的转换类型,然后单击确定。

I am hoping I can find someone here who can help me with that. Basically my overall hope is to make myself a little jquery based input like calculator. I key in my px, pt, %, other and select my conversion to type and click ok.

创建计算,足够简单。

Creating the calculate, easy enough. The math I would have to apply on a per conversion basis not so much, and thats what I am hoping to find here so I can do it.

推荐答案

好吧,

12pt = 16px = 1em = 100%

12pt = 16px = 1em = 100%

t更改主体上的字体大小(否则pt将不同),您的操作系统的dpi设置为72等等。

assuming you don't change the font size on the body (else the pt will be different), the dpi of your OS is set at 72 etc etc..

关系看起来像:

pt = 3/4*px

em = pt/12

% = pt*100/12

值得指出的是,使用pt是错误的,除非你正在打印东西,而使用px,%或em更常见。

in this case. It's worth pointing out that using pt is wrong, unless you are printing something, and that using px, % or em is more usual.

em。对于较小屏幕的基本字体大小更改的设计,使用%或em非常方便。

Personally, I just use px or em. Using % or em is handy for designs where the base font size changes for smaller screens.

这篇关于转换率pt,em,px,percent,other的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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