当前位置:网站首页>Explore the conversion between PX pixels and Pt pounds, mm and MM
Explore the conversion between PX pixels and Pt pounds, mm and MM
2022-07-03 02:02:00 【Fixed bolt】
List of articles
Pixel as a size of image , Only exists in computers , Like RGB Like color patterns, they only exist in computers . A pixel is a virtual unit , There is no pixel unit in real life .
In reality, we see a person , Can you say how many pixels tall it is ? You can't , Usually we say he has 1.82 Meter high , perhaps 182 Centimeter etc . All used are traditional length units . The traditional unit of length is millimeter 、 centimeter 、 Decimeter 、 rice 、 km 、 Light year and other units .
DPI(Dots Per Inch)
Pixels per inch . When scanning and printing, there are generally DPI Optional .Windows The system default is 96dpi,Apple The system default is 72dpi.
px Pixels (Pixel)
Relative length unit . It's a virtual unit of length . It's the unit of digital image length of a computer system , If px To convert to physical length , You need to specify precision DPI.
em
Due to the difference of screen size , The display effect of the same size font under different screens is quite different . So dynamic amplification / Reducing the font becomes more important . Obviously, it is complex to make compatibility for every font setting , So there was em and rem.
em It's a unit of relative length . Relative to the font size of the text in the current object .
For example, the font size of the current inline text is not set artificially , Relative to the browser's default font size .
Because the default font size of the browser is 16px, Therefore, browsers that have not adjusted the default font size conform to : 1em = 16px.
em Inherits the font size of the parent element . thus , Just change the font size of the parent element , You can synchronously enlarge or shrink the font of small elements .
But there are also a few points to pay attention to :
- body The selector declares Font-size=62.5% (10 ÷ 16 × 100% = 62.5%);
- Put your original px Number divided by 10, Then put on em As a unit ;
- Recalculate the magnified fonts em The number . Avoid repeating declaration of font size .
rem (font size of the root element)
because em There is a problem of inheriting the parent element , When changing the font size, the inheritance relationship involved becomes complicated .
rem Is the size relative to the font size of the root element . Such as The text size is set to font-size: 10px, be 1rem = 10px. Use rem Setting the font is much simpler .
in Inch (Inch)
A unit of absolute length .
pt pounds (Point)
A unit of absolute length . It's a unit of physical length , refer to 72 A quarter of an inch .
1in = 72pt
mm mm (Millimeter)
A unit of absolute length .
1in = 25.4 mm = 72pt
cm centimeter (Centimeter)
A unit of absolute length .
1in = 2.54cm = 72pt
pt And px Conversion formula
pt and px The conversion formula of can be based on pt The definition of comes to :
pt = 1/72( Inch ), px = 1/dpi( Inch )
therefore pt = px * dpi / 72
With Windows Under the 96dpi To calculate
pt = px * 96/72 = px * 4/3 = px * 1.33
Basically 1pt About equal to 1.33 Pixels
mm And px Conversion formula
from pt = px * dpi / 72
Then you know 1in = 25.4mm = 72pt
be 25.4mm/72 = px * dpi / 72
have to mm = px * dpi / 25.4
With Windows Under the 96dpi To calculate
mm = px * 96 / 25.4
mm = px * 3.78
Basically 1 mm About equal to 3.78 Pixels
边栏推荐
- 2022 spring "golden three silver four" job hopping prerequisites: Software Test interview questions (with answers)
- Types of map key and object key
- Swift development learning
- 网络安全-钓鱼
- leetcode961. Find the elements repeated N times in the array with length 2n
- [error record] navigator operation requested with a context that does not include a naviga
- 网络安全-防火墙
- Network security - virus
- 詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
- 自定义组件、使用npm包、全局数据共享、分包
猜你喜欢

Learn BeanShell before you dare to say you know JMeter

Anna: Beibei, can you draw?

Asian Games countdown! AI target detection helps host the Asian Games!

Bottleneck period must see: how can testers who have worked for 3-5 years avoid detours and break through smoothly

微信小程序開發工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理問題

Custom components, using NPM packages, global data sharing, subcontracting

Sweet talk generator, regular greeting email machine... Open source programmers pay too much for this Valentine's day

y54.第三章 Kubernetes从入门到精通 -- ingress(二七)
![[Appendix 6 Application of reflection] Application of reflection: dynamic agent](/img/e7/0ee42902b178b13e9a41385267e7b6.jpg)
[Appendix 6 Application of reflection] Application of reflection: dynamic agent

Redis:Redis的简单使用
随机推荐
LabVIEW安装第三方VISA软件后NI VISA失效
Visual yolov5 format data set (labelme JSON file)
Swift开发学习
How to find summer technical internship in junior year? Are you looking for a large company or a small company for technical internship?
网络安全-openvas
[Appendix 6 Application of reflection] Application of reflection: dynamic agent
What are the differences between software testers with a monthly salary of 7K and 25K? Leaders look up to you when they master it
stm32F407-------IIC通讯协议
Network security - scanning and password explosion 2
网络安全-密码破解
Redis:Redis的简单使用
微信小程序開發工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理問題
Network security - vulnerabilities and Trojans
Network security - Information Collection
Huakaiyun (Zhiyin) | virtual host: what is a virtual host
网络安全-DNS欺骗与钓鱼网站
全链路数字化转型下,零售企业如何打开第二增长曲线
How do browsers render pages?
Button button adaptive size of wechat applet
[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)