Search code examples
cssfontsfont-size

Font size in CSS - % or em?


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


Solution

  • 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.