Traditional Culture Encyclopedia - Photography major - What is the difference between pt and px in html?

What is the difference between pt and px in html?

The difference between pt and px is that:

1, px means pixel, which is the most basic point for displaying data on the screen. Pt is a point, which is a common unit in the printing industry, and is equal to 1/72 inches.

2, px is a point, which is not a unit of length in nature. It can be drawn very small or very large. If the point is small and the picture is clear, we call it "high resolution", otherwise it is "low resolution". So the size of the "point" will change, which is the so-called "relative length". The full name of pt is point, but it is not called "point" in Chinese. As can be seen from the CHAJINSHAN PowerWord, the exact name is a special printing unit "pound", the size of which is 1/72 inches, so it is a natural standard unit of length, also called "absolute length".

3. Both px and pt will become smaller with the increase of resolution, because everything displayed on the interface, such as words, pictures or tables, is presented through the distribution of pixels, so when all length units including pt are displayed based on the screen, they will be converted into the number of pixels before being displayed.

So as far as computer screen is concerned, there is no essential difference between relative length and absolute length. Any unit is actually a pixel, and the difference is only the proportion.

5. But no matter what resolution the screen uses, the printing size of pt is the same, because the pixel size can change with the resolution, and pt will change after being converted into pixels, but in any case, the actual value of pt is unchanged, in other words, the basic length unit may not be pixels, but other units consistent with the measurement unit in life, such as daily printers.

Extended data

(A) the characteristics of the html language

Hypertext Markup Language (Hypertext Markup Language) document making is not very complicated, but it is powerful and supports the embedding of files with different data formats, which is one of the reasons why the World Wide Web (WWW) is popular. Its main features are as follows:

1, concise: Hypertext Markup Language version upgrade adopts superset mode, which is more flexible and convenient.

2. Extensibility: The wide application of Hypertext Markup Language brings the requirements of strengthening functions and increasing identifiers. Hypertext Markup Language (Hypertext Markup Language) adopts the way of element subclassing, which ensures the expansibility of the system.

3. Platform independence: Although personal computers are very popular, many people use other machines such as Macs. Hypertext Markup Language can be used on a wide range of platforms, which is another reason why the World Wide Web (WWW) is popular.

4. Universality: In addition, HTML is the universal language of the network, a simple and universal integrated markup language. It allows web page makers to create complex pages that combine text and pictures, and these pages can be viewed by anyone else on the Internet, no matter what type of computer or browser they use.

(2) PX is the abbreviation of Pixel.

In other words, a pixel refers to the basic primitive pigment and its basic coding of gray level, which consists of the letters of the words picture and element. Like photographs, digital images have continuous tones.

(3) px is the pixel unit, em is the relative unit, and pt is the absolute unit.

1, their respective advantages are: px can be used on computer screens, and it can achieve the desired effect, and it can also achieve the desired effect on high-resolution devices such as printers.

2.em has many advantages. For example, on a page, you have given the font size of the parent element, so you can change the size of all elements proportionally by adjusting one element.

3. It can be scaled freely, for example, making scalable style sheets. Pt is a unit of measurement with fixed length, which can be measured by measuring equipment. Absolute units are of limited use because they cannot be scaled, and are usually used only when you already know what kind of output media they are used for.

4, but in most cases it is best to use relative units. Px and em are generally better.

Baidu encyclopedia: html

Baidu encyclopedia: pt

Baidu encyclopedia: px