What is the difference between css pt and px?

Source: Internet
Author: User

There are two common types: px and pt. What are the differences between the two?

Px: pixel, pixel, minimum unit displayed on the screen;

Pt: point, which is a standard unit of length in the printing industry. 1pt = 1/72 inch;

In Windows, the text is defined as 96 dpi in the default display settings. This shows that 1px = 1/96 inch; while 1pt = 1/72 inch, we can conclude that in this setting, 1px = 0.75pt and the font size is 9pt = 12px.

However, you can modify the dpi size defined by the text, for example, to 144 dpi. In this way, 1px = 0.5pt and the font is 9pt = 18px. A text originally composed of 12 px, which is now composed of 18 px. If more px is used, the text is "big" and easier to read.

Therefore, the difference between px and pt is that px will change with the display resolution, and pt will change with the font size setting in Windows.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.