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

27/365 : Escape

Large Format Study N. 14

let the wind blows

More Photos

Blogroll

Recent Posts

Recent Comments

Satheeshmuthu on Sachin silences the critics [ …
Satheeshmuthu on Sachin silences the critics [ …
izdelava spletne str… on Convert em,px,pt and % in…
CSS References, Tuto… on Convert em,px,pt and % in…
shirley on Convert em,px,pt and % in…

Pages

Top Clicks

Top Posts

Blog Stats