I would strongly advise against setting the body font-size
in terms of px, as this overrides any browser settings the user may have put in and thus is a bad accessibility decision. Personally, I see no reason to set the body font-size
at all, except maybe for mobile; but if you need to set it, it's probably best to set it as a percentage or in em
s.
Let me give a personal example. I have intermittent eye problems. On good days, I use the "normal" font-size (16); whereas on bad days, I increase the font-size in my browser (in Chrome, Settings->Advanced->Font Size) to 18, 20, or even higher.
Today, I have the size set higher. In your Fiddle, clicking on % or em shows me the larger font size I set and hoped to see across all sites, whereas clicking on px overrides that setting and forces me to either zoom in or manually override the styles myself.
As a side note, the whole point of setting widths in terms of em
s is that an object with width 5em
has a varying width in pixels but a constant width in proportion to the font-size of the element. If you really want something to have a definite width in px, you should specify px; if you want it to vary with the font-size (e.g., a column width), you may well want to use em
s.