em

topic posted Sun, February 10, 2008 - 11:10 PM by  JAKEYERBOOTY
Share/Save/Bookmark
Advertisement
Why should I use "em" for font size rather than points?

its very unintuitive for me.

Is there some good explanation for how best to utilize and understand that tag?

Thx
J
posted by:
JAKEYERBOOTY
SF Bay Area
Advertisement
Advertisement
  • Re: em

    02/11
    em is a relative font definition. it is a percentage of a particular font size. so if your default font size is 12px then:

    1em = 12px
    1.5em = 18px
    2em = 24px

    so on and so forth.

    Whats the benefit? Well in some versions of some browsers the use of hard font sizes (pixels, points) prevents the user from using the increase/decrease fontsize functions within their browser. Alot of users never use but for example if you have a large demographic of seniors they may expect to be able to increase the font size so they can read it.

    Thats the practical answer. The theoretical answer comes form the old typesetting and graphic design trades. That is that everything is laid out on a baseline grid. By using em it it much easier to manipulate the type sizes consitently across the site, and ensure that baselines align to the grid.

    You can read more about this here:

    www.subtraction.com/archives...eaahh.php (make sure you read the pdf of the slide deck)
    alistapart.com/articles/s...ypeontheweb
    24ways.org/2006/compose...rtical-rhythm
  • Re: em

    02/11
    Also dont confuse "em" the measurement with <em> the tag. the two have nothing to do with each other :-)

Recent topics in "CSS is not a disease!"