Unit comparison
First value
Second value
-
-
单位对照表
| 绝对单位 | |||
|---|---|---|---|
| Unit | Description | Visualization | 计算值 (px) |
| cm | centimeters | - | |
| mm | millimeters | - | |
| Q | quarter-millimeters | - | |
| in | 英寸 (1in = 96px) | - | |
| pc | 派卡 (1pc = 16px) | - | |
| pt | points (1pt = 1/72in) | - | |
| px | pixels (relative to the device) | - | |
| 相对单位 | |||
| Unit | Description | Visualization | 计算值 (px) |
| em | relative to the element font size | - | |
| rem | relative to the root element font size | - | |
| ex | relative to the height of character "x" | - | |
| ch | relative to the width of character "0" | - | |
| vw | 1% of viewport width | - | |
| vh | 1% of viewport height | - | |
| vmin | 1% of the smaller viewport dimension | - | |
| vmax | 1% of the larger viewport dimension | - | |
| % | relative to the parent element (usually width) | - | |
| cap | relative to capital-letter height | - | |
| ic | relative to ideographic-character width | - | |
| lh | relative to its own line height | - | |
| rlh | relative to the root element line height | - | |
| vi | relative to viewport inline size | - | |
| vb | relative to viewport block size | - | |