Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
CSS Length Units
In CSS, there are two types of length units, absolute length units and relative length units respectively.
Absolute length Unit
Absolute length units are divided into in (inches), cm (cm), mm (mm), pt (LB), PC (PICA). Among them, in (inches), cm (cm), mm (mm) and the actual common units are exactly the same. Focus on the PT (LB), PC (PICA).
PT (LB): is a commonly used unit in standard printing, with a length of 72pt of 1 inches.
PC (PICA): This is also a printing unit, with a 1pc length of 12 lbs.
Absolute length units, though easy to understand, are rarely used in the design of Web pages.
Relative length Units
The relative length unit is the maximum length unit used. including EM, ex, PX, described below separately.
EM is a value that defines the size of the text, which is the value of the Font-size property in the text. For example: To define the text size of an element of 12pt, then, for this element 1em is 12pt,2em is 24pt. The actual size of the unit EM is affected by the font size.
The ex is similar to EM, referring to the height of the letter x in the text, because the height of the x of the different fonts is different, so the actual size of the ex is affected by two factors of the font and font size.
PX is commonly referred to as the pixel, so that the page design uses the most units of length. Divide the display into very small squares, and each square is a pixel. On the surface it seems to be easy to understand, in fact, the specific size of PX is affected by the resolution of the screen, that is, and the way to divide the screen. For example, a font of 100px size, if the display uses the resolution of 800x600 pixels, the width of each word is 1/8 of the screen. If the resolution of the monitor is set to 1024x768 pixels, the same 100px font will have a width of 1/10 of the screen width.
This article links http://www.cxybl.com/html/wyzz/CSS/20120601/27377.html
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.