CSS font-size

Specify font-size:100%; for body, which will result (with browsers default settings) in a default font size of 16px.
Then specify further font-sizes in relative em.
em is always relative to the parent elements size.

line-height can be specified in em as well.

body { font-size:100%; }<br />* { font-size:''x''em; }

You can calculate pixel values for em and em values for wanted pixel values (again, with the 16px as a base):

  • em = px / 16
  • px = 16 * em