The difference between PX and PT in CSS code

Source: Internet
Author: User
Tags define definition relative
PT is an absolute unit, 1 PT =1/72 inch One is the equipment coordinates, one is the logical coordinates, the two are different.

PX is a relative unit, and the general pixel reference value is: On a monitor with a pixel density of PDI, the normal person should see a pixel from 28 inches from the monitor should be no less than 0.0227 degrees. 1 PX definition does not change after setting to a large font; PT definition will change.

2 px is relative unit, PT is absolute unit
If you do the Web page is to browse rather than print, we suggest PX to define the font size, for the following reasons:
1. As mentioned in the preceding Jet, PX refers to the number of elephants, the concept of the number of images itself is to be cited, and PT (point value) is to a large extent in order to print error, printing and display is very different, here is not much to say, Kyrgyzstan said the situation is also the disadvantage of using Pt.
2. Most of the default units in the Html code, such as width=10, and so on, are PX as the unit, the total width of the screen is also PX as a unit, 800*600 is wide 800px; High 600px; We define the font size to be 12px; can be very convenient to calculate, for example, 10 Chinese characters, his width is 10*12=120, we can easily write a width=120 form to box him, this is just an example.
3. Please do a test, the body {font-size:10.5pt;} and the body {font-size:14.7px}, the two definitions, let Netscape show that the 10.5-point comparison optimized font size, only defined as 14.7px OK, otherwise only IE will know.

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.