em conversion in css

August 9, 2007

Before converting em’s read the below paragraph carefully.

Originally from the typographic world, an em is a unit that represents the height of the capital letter M for a particular font. In Web pages, one em is the height of the Web browser’s base text size, which is usually 16 pixels. However, anyone can change that base size setting, so 1em may be 16 pixels for one person, but 24 pixels in someone else’s browser. In other words, ems are a relative unit of measurement.

In addition to the browser’s initial font size setting, ems can inherit size information from containing tags. A type size of .9em would make text about 14 pixels tall on most browsers with a 16 pixel base size. But if you have a <p> tag with a font size of .9ems, and then a <strong> tag with a font size of .9ems inside that <p> tag, that <strong> tag’s em size isn’t 14 pixels it’s 12 pixels (16 x .9 x .9). So keep inheritance in mind when you use em values.

Entry Filed under: css. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Spam Blocked

Flickr Photos

eight.

The edge of a Dutch kingdom

I'm still standing................. yeah yeah yeah

More Photos

Blogroll

Recent Posts

Recent Comments

izdelava spletnih st… on min-height hack/workaround in …
kathmandu flights on iframe change src | javas…
Ali A. Akbar on min-height hack/workaround in …
izdelava spletnih st… on WordPress Themes
izdelava spletnih st… on Top 25 medical colleges

Pages

Top Clicks

Top Posts

Blog Stats