px vs em revisited

Out of context: Reply #18

  • Started
  • Last post
  • 22 Responses
  • Stugoo0

    I've always used ems for font size, the finest way to do it is to set
    body {font-size : 62.5% }
    then
    1em ~ 10px.
    so
    1.6em font size gets rendered as 16px.
    Job done.

    Regardless, with reference to desktops & tablets, width is the important constant.... keeping sites for 1024 width has been the lowest common denominator for a good 8 years now, and thanks to apple probably will be for the foreseeable future.

    As for vertical content, a good developer never explicitly sets the height, but perhaps uses a min-height instead.
    Thus have never really had any difficutly with ems, except when nesting elements semanticly and having to change the font size.

    • However points raised in the article are worth thinking about.Stugoo
    • You should still define in pixels your 100% baseline. Although most browsers are the same, some devices are not.ETM

View thread