css的长度换算
1in = 2.54cm = 25.4 mm = 72pt = 6pc ;
- PX to EM: Example: 12px / 16px = .75em
- PX to %: Example: 12px / 16px * 100 = 75%
- PX to PT: Example: 16px * 72 (72 points = 1 inch) / 96 (96 pixels per inch in Windows, 72 in Mac) = 12pt
- EM to PX: Example: .75em * 16px = 12px
- EM to %:Example: .75em * 100 = 75%
- % to PX:Example: 75 * 16px / 100 = 12px
- % to EM:Example: 75 / 100 = .75em
- PT to PX: Example: 12pt * 96ppi / 72ppi = 16px
Pixels | EMs | Percent | Points |
---|---|---|---|
6px | 0.375em | 37.5% | 5pt |
7px | 0.438em | 43.8% | 5pt |
8px | 0.5em | 50% | 6pt |
9px | 0.563em | 56.3% | 7pt |
10px | 0.625em | 62.5% | 8pt |
11px | 0.688em | 68.8% | 8pt |
12px | 0.75em | 75% | 9pt |
13px | 0.813em | 81.3% | 10pt |
14px | 0.875em | 87.5% | 11pt |
15px | 0.938em | 93.8% | 11pt |
16px | 1em | 100% | 12pt |
17px | 1.063em | 106.3% | 13pt |
18px | 1.125em | 112.5% | 14pt |
19px | 1.188em | 118.8% | 14pt |
20px | 1.25em | 125% | 15pt |
21px | 1.313em | 131.3% | 16pt |
22px | 1.375em | 137.5% | 17pt |
23px | 1.438em | 143.8% | 17pt |
24px | 1.5em | 150% | 18pt |
莫愁前路无知己,天下无人不识君。