Font size in CSS - % or em?

Mats picture Mats · Sep 25, 2008 · Viewed 45.9k times · Source

When setting the size of fonts in CSS, should I be using a percent value (%) or em? Can you explain the advantage?

Answer

Glenn Slaven picture Glenn Slaven · Sep 25, 2008

There's a really good article on web typography on A List Apart.

Their conclusion:

Sizing text and line-height in ems, with a percentage specified on the body (and an optional caveat for Safari 2), was shown to provide accurate, resizable text across all browsers in common use today. This is a technique you can put in your kit bag and use as a best practice for sizing text in CSS that satisfies both designers and readers.