CSS Units for Measurement
- Absolute Length Units
- in - Inches
- cm - Centimeters
- mm - Millimeters
- pt - Points
- pc - Picas
- Relative Length Units
- em - em-height: An em is the size in points of that element. If the font-size of an element is 14 points, then 1 em is 14 points.
- ex - x-height: An ex is similar but refers to the size of the lower case x for that element.
- px - pixels
- Percentage values
- h1.high {line-height: 150%}
- What to do?
- Use em and px (esp. for images)
- Examples
- h1 {font-size:20px}
- h2 {font-size:18px; width:25em}
- p.narrow {width:2in; margin:1in;}