Cascading Style Sheetsarticles and tutorials
CSS different units for expressing length 详细介绍了 CSS 使用的长度单位,以及使用解释。
其中绝对长度单位转换关系如下:
unit definition
---- ----------
‘cm’ centimeters
‘mm’ millimeters
‘in’ inches; 1in is equal to 2.54cm
‘px’ pixels; 1px is equal to 1/96th of 1in
‘pt’ points; 1pt is equal to 1/72nd of 1in
‘pc’ picas; 1pc is equal to 12pt
px 是一个特殊单位,在屏幕上显示时,1px 是一个像素,在打印物上显示时,1px = 1/96 in:
In fact, CSS requires that 1px must be exactly 1/96th of an inch in all printed output. CSS considers that printers, unlike screens, do not need to have different sizes for px in order to print sharp lines. In print media, a px thus not only has the same visual appearance from one device to another, but indeed it is measurably the same.
对 point/pt 的介绍:Point (typography)
相对单位(em、ex 等)的定义和使用见 CSS different units for expressing length。