$node = stdClass Object (
[nid] => [102]
[type] => [blog]
[language] => [en]
[uid] => [7]
[status] => [1]
[created] => [1266352514]
[changed] => [1266512505]
[comment] => [0]
[promote] => [0]
[moderate] => [0]
[sticky] => [0]
[tnid] => [0]
[translate] => [0]
[vid] => [105]
[revision_uid] => [1]
[title] => [CSS Font-Sizes]
[body] => [<div class="diggthis_button"><script type="text/javascript"><!--
digg_url = 'http://webeasymedia.com/blog/ryan/2010/02/css-font-sizes';
digg_title = 'CSS Font-Sizes';
digg_bodytext = "As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.";
digg_skin = 'standard';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="field field-type-filefield field-field-main-image">
<div class="field-items">
<div class="field-item odd">
<img src="http://webeasymedia.com/sites/webeasymedia.com/files/imagecache/article_image/css-tricks.jpg" alt="" title="" class="imagecache imagecache-article_image imagecache-default imagecache-article_image_default" width="275" height="119" /> </div>
</div>
</div>
<p>As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.</p>
<h3>The Units:</h3>
<ol>
<li><strong>“Ems” (em):</strong> The “em” is a scalable unit that is used in web document media. An em is equal to the current font-size, for instance, if the font-size of the document is 12pt, 1em is equal to 12pt. Ems are scalable in nature, so 2em would equal 24pt, .5em would equal 6pt, etc. Ems are becoming increasingly popular in web documents due to scalability and their mobile-device-friendly nature.</li>
<li><strong>Pixels (px):</strong> Pixels are fixed-size units that are used in screen media (i.e. to be read on the computer screen). One pixel is equal to one dot on the computer screen (the smallest division of your screen’s resolution). Many web designers use pixel units in web documents in order to produce a pixel-perfect representation of their site as it is rendered in the browser. One problem with the pixel unit is that it does not scale upward for visually-impaired readers or downward to fit mobile devices.</li>
<li><strong>Points (pt):</strong> Points are traditionally used in print media (anything that is to be printed on paper, etc.). One point is equal to 1/72 of an inch. Points are much like pixels, in that they are fixed-size units and cannot scale in size.</li>
<li><strong>Percent (%):</strong> The percent unit is much like the “em” unit, save for a few fundamental differences. First and foremost, the current font-size is equal to 100% (i.e. 12pt = 100%). While using the percent unit, your text remains fully scalable for mobile devices and for accessibility.</li>
</ol>
<h3>Why should I use one of these over another?</h3>
<p>It’s easy to understand the difference between font-size units when you see them in action. Generally, <strong>1em = 12pt = 16px = 100%</strong>. When using these font-sizes, let’s see what happens when you increase the base font size (using the body CSS selector) from 100% to 120%.</p>
<p><img alt="" height="116" width="480" src="/sites/webeasymedia.com/files/font-size.gif" /></p>
<p>In looking at the table above, it is apparent that both the em and percent units get larger as the base font-size increases, but pixels and points do not. Some people may argue that it is much easier to set an absolute size for your text using pixles(px) or points(pt), but you can acheive a much better experience for your visitors when using scalable text. Scalable text can be displayed appropriately on any device or any machine. This is especially useful now, as more and more of your end users may be viewing your content on a mobile device such as an iPhone or BlackBerry. For this reason, the em and percent units are preferred for web document text.</p>
<h3>It seems complicated to convert pixels (px) to ems (em). How can I make it easier?</h3>
<p>Normally you would use a conversion table to figure out what your <em>font-size</em> should be from pixels (px) to ems (em). Many people try to wing it or spend some time guessing numbers, but there is a much easier way. If the html body is set to 1em (browser standard: 1em = 16px), and the <em>font-size</em> you would want is 12px that would be 0.75em. e.g. 10px converts to 0.625em, 22px converts to 1.375em.</p>
<p>Now to make this easier:</p>
<p>You can set the <em>font-size</em> of the body to 62.5% (that is 62.5% of the browser default of 16px), which equates to 10px, or 0.625em. Now you can set your f<em>ont-size</em> in ems with an easy to remember conversion. All you need to do is divide the px value by 10 to get your em value.</p>
<ul>
<li>12px = 1.2em</li>
<li>13px = 1.3em</li>
<li>16px = 1.6em</li>
<li>8px = 0.8em</li>
<li>etc…</li>
</ul>
<p>This little trick makes your conversions very easy to remember and eliminates the need for conversion tables. There is one caveat though... you will still need to use a conversion table for nested elements when using ems, since the <code>font-size:</code> declaration in your css is relative to the element's parent. For example: a specification of <code>font-size:0.8em;</code> implies a font-size that is 0.8 times the <em>em size</em> of the parent element.</p>
<script type="text/javascript">var disqus_title = "CSS Font-Sizes";var disqus_message = "As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.";var disqus_developer = 1;</script><div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/webeasy/embed.js"></script><noscript><a href="http://webeasy.disqus.com/?url=ref">View the forum thread.</a></noscript>]
[log] => []
[revision_timestamp] => [1266512505]
[format] => [1]
[name] => [Ryan Ours]
[picture] => [sites/webeasymedia.com/files/pictures/picture-7.jpg]
[data] => [a:8:{s:13:"form_build_id";s:37:"form-6800b4e02fa21c7e2a0d74177bfff9d4";s:7:"contact";i:1;s:14:"pingfm_app_key";s:0:"";s:5:"Title";s:14:"Ryan's Musings";s:11:"Description";s:82:"The thoughts, ideas, tips & tricks that are currently running through Ryan's head.";s:6:"format";s:1:"1";s:14:"picture_delete";s:0:"";s:14:"picture_upload";s:0:"";}]
[path] => [blog/ryan/2010/02/css-font-sizes]
[field_subtitle] => array (
[0] => array (
[value] => [Best practices for readability and accessibility of your web-fonts.]
[safe] => [Best practices for readability and accessibility of your web-fonts.]
)
)
[field_main_image] => array (
[0] => array (
[fid] => [276]
[list] => [1]
[data] => array (
[description] => []
[alt] => []
[title] => []
)
[uid] => [7]
[filename] => [css-tricks.jpg]
[filepath] => [sites/webeasymedia.com/files/css-tricks.jpg]
[filemime] => [image/jpeg]
[filesize] => [31595]
[status] => [1]
[timestamp] => [1266350937]
[nid] => [102]
)
)
[field_links] => array (
[0] => array (
[url] => []
[title] => []
[attributes] => []
)
)
[webform] => array (
[addblock] => []
)
[morelikethis] => array (
[enabled-contribs] => []
[prefill-with-calais] => []
)
[taxonomy] => array (
[91] => stdClass (
)
[92] => stdClass (
)
[46] => stdClass (
)
[89] => stdClass (
)
)
[files] => array (
)
[page_title] => []
[nodewords] => array (
)
[build_mode] => [0]
[readmore] => [1]
[content] => array (
[diggthis_button] => array (
[#weight] => [-20]
[#value] => [<div class="diggthis_button"><script type="text/javascript"><!--
digg_url = 'http://webeasymedia.com/blog/ryan/2010/02/css-font-sizes';
digg_title = 'CSS Font-Sizes';
digg_bodytext = "As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.";
digg_skin = 'standard';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>]
[#title] => []
[#description] => []
[#printed] => [1]
)
[field_main_image] => array (
[#type_name] => [blog]
[#context] => [full]
[#field_name] => [field_main_image]
[#post_render] => array (
[0] => [content_field_wrapper_post_render]
)
[#weight] => [-2]
[field] => array (
[#description] => []
[items] => array (
[0] => array (
[#formatter] => [article_image_default]
[#node] => stdClass (
)
[#type_name] => [blog]
[#field_name] => [field_main_image]
[#weight] => [0]
[#theme] => [imagecache_formatter_article_image_default]
[#item] => array (
[fid] => [276]
[list] => [1]
[data] => array (
[description] => []
[alt] => []
[title] => []
)
[uid] => [7]
[filename] => [css-tricks.jpg]
[filepath] => [sites/webeasymedia.com/files/css-tricks.jpg]
[filemime] => [image/jpeg]
[filesize] => [31595]
[status] => [1]
[timestamp] => [1266350937]
[nid] => [102]
[#delta] => [0]
)
[#title] => []
[#description] => []
[#theme_used] => [1]
[#printed] => [1]
[#type] => []
[#value] => []
[#prefix] => []
[#suffix] => []
[#children] => [<img src="http://webeasymedia.com/sites/webeasymedia.com/files/imagecache/article_image/css-tricks.jpg" alt="" title="" class="imagecache imagecache-article_image imagecache-default imagecache-article_image_default" width="275" height="119" />]
)
[#title] => []
[#description] => []
[#children] => [<img src="http://webeasymedia.com/sites/webeasymedia.com/files/imagecache/article_image/css-tricks.jpg" alt="" title="" class="imagecache imagecache-article_image imagecache-default imagecache-article_image_default" width="275" height="119" />]
[#printed] => [1]
)
[#single] => [1]
[#attributes] => array (
)
[#required] => []
[#parents] => array (
)
[#tree] => []
[#context] => [full]
[#page] => [1]
[#field_name] => [field_main_image]
[#title] => [Image]
[#access] => [1]
[#label_display] => [hidden]
[#teaser] => []
[#node] => stdClass (
)
[#type] => [content_field]
[#children] => [<img src="http://webeasymedia.com/sites/webeasymedia.com/files/imagecache/article_image/css-tricks.jpg" alt="" title="" class="imagecache imagecache-article_image imagecache-default imagecache-article_image_default" width="275" height="119" />]
[#printed] => [1]
)
[#title] => []
[#description] => []
[#children] => [<div class="field field-type-filefield field-field-main-image">
<div class="field-items">
<div class="field-item odd">
<img src="http://webeasymedia.com/sites/webeasymedia.com/files/imagecache/article_image/css-tricks.jpg" alt="" title="" class="imagecache imagecache-article_image imagecache-default imagecache-article_image_default" width="275" height="119" /> </div>
</div>
</div>
]
[#printed] => [1]
)
[body] => array (
[#weight] => [-1]
[#value] => [<p>As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.</p>
<h3>The Units:</h3>
<ol>
<li><strong>“Ems” (em):</strong> The “em” is a scalable unit that is used in web document media. An em is equal to the current font-size, for instance, if the font-size of the document is 12pt, 1em is equal to 12pt. Ems are scalable in nature, so 2em would equal 24pt, .5em would equal 6pt, etc. Ems are becoming increasingly popular in web documents due to scalability and their mobile-device-friendly nature.</li>
<li><strong>Pixels (px):</strong> Pixels are fixed-size units that are used in screen media (i.e. to be read on the computer screen). One pixel is equal to one dot on the computer screen (the smallest division of your screen’s resolution). Many web designers use pixel units in web documents in order to produce a pixel-perfect representation of their site as it is rendered in the browser. One problem with the pixel unit is that it does not scale upward for visually-impaired readers or downward to fit mobile devices.</li>
<li><strong>Points (pt):</strong> Points are traditionally used in print media (anything that is to be printed on paper, etc.). One point is equal to 1/72 of an inch. Points are much like pixels, in that they are fixed-size units and cannot scale in size.</li>
<li><strong>Percent (%):</strong> The percent unit is much like the “em” unit, save for a few fundamental differences. First and foremost, the current font-size is equal to 100% (i.e. 12pt = 100%). While using the percent unit, your text remains fully scalable for mobile devices and for accessibility.</li>
</ol>
<h3>Why should I use one of these over another?</h3>
<p>It’s easy to understand the difference between font-size units when you see them in action. Generally, <strong>1em = 12pt = 16px = 100%</strong>. When using these font-sizes, let’s see what happens when you increase the base font size (using the body CSS selector) from 100% to 120%.</p>
<p><img alt="" height="116" width="480" src="/sites/webeasymedia.com/files/font-size.gif" /></p>
<p>In looking at the table above, it is apparent that both the em and percent units get larger as the base font-size increases, but pixels and points do not. Some people may argue that it is much easier to set an absolute size for your text using pixles(px) or points(pt), but you can acheive a much better experience for your visitors when using scalable text. Scalable text can be displayed appropriately on any device or any machine. This is especially useful now, as more and more of your end users may be viewing your content on a mobile device such as an iPhone or BlackBerry. For this reason, the em and percent units are preferred for web document text.</p>
<h3>It seems complicated to convert pixels (px) to ems (em). How can I make it easier?</h3>
<p>Normally you would use a conversion table to figure out what your <em>font-size</em> should be from pixels (px) to ems (em). Many people try to wing it or spend some time guessing numbers, but there is a much easier way. If the html body is set to 1em (browser standard: 1em = 16px), and the <em>font-size</em> you would want is 12px that would be 0.75em. e.g. 10px converts to 0.625em, 22px converts to 1.375em.</p>
<p>Now to make this easier:</p>
<p>You can set the <em>font-size</em> of the body to 62.5% (that is 62.5% of the browser default of 16px), which equates to 10px, or 0.625em. Now you can set your f<em>ont-size</em> in ems with an easy to remember conversion. All you need to do is divide the px value by 10 to get your em value.</p>
<ul>
<li>12px = 1.2em</li>
<li>13px = 1.3em</li>
<li>16px = 1.6em</li>
<li>8px = 0.8em</li>
<li>etc…</li>
</ul>
<p>This little trick makes your conversions very easy to remember and eliminates the need for conversion tables. There is one caveat though... you will still need to use a conversion table for nested elements when using ems, since the <code>font-size:</code> declaration in your css is relative to the element's parent. For example: a specification of <code>font-size:0.8em;</code> implies a font-size that is 0.8 times the <em>em size</em> of the parent element.</p>
]
[#title] => []
[#description] => []
[#printed] => [1]
)
[#content_extra_fields] => array (
[title] => array (
[label] => [Title]
[description] => [Node module form.]
[weight] => [-5]
)
[body_field] => array (
[label] => [Body]
[description] => [Node module form.]
[weight] => [-1]
[view] => [body]
)
[revision_information] => array (
[label] => [Revision information]
[description] => [Node module form.]
[weight] => [3]
)
[menu] => array (
[label] => [Menu settings]
[description] => [Menu module form.]
[weight] => [1]
)
[taxonomy] => array (
[label] => [Taxonomy]
[description] => [Taxonomy module form.]
[weight] => [-3]
)
[path] => array (
[label] => [Path settings]
[description] => [Path module form.]
[weight] => [4]
)
[attachments] => array (
[label] => [File attachments]
[description] => [Upload module form.]
[weight] => [2]
[view] => [files]
)
[nodewords] => array (
[label] => [Nodewords]
[description] => [Nodewords fieldset.]
[weight] => [5]
)
)
[#pre_render] => array (
[0] => [content_alter_extra_weights]
)
[field_links] => array (
[#type_name] => [blog]
[#context] => [full]
[#field_name] => [field_links]
[#post_render] => array (
[0] => [content_field_wrapper_post_render]
)
[#weight] => [0]
[field] => array (
[#description] => []
[items] => array (
[0] => array (
[#formatter] => [default]
[#node] => stdClass (
)
[#type_name] => [blog]
[#field_name] => [field_links]
[#weight] => [0]
[#theme] => [link_formatter_default]
[#item] => array (
[url] => []
[title] => []
[attributes] => []
[#delta] => [0]
)
[#title] => []
[#description] => []
[#theme_used] => [1]
[#printed] => [1]
[#type] => []
[#value] => []
[#prefix] => []
[#suffix] => []
)
[#title] => []
[#description] => []
[#printed] => [1]
)
[#single] => [1]
[#attributes] => array (
)
[#required] => []
[#parents] => array (
)
[#tree] => []
[#context] => [full]
[#page] => [1]
[#field_name] => [field_links]
[#title] => [Related Links]
[#access] => [1]
[#label_display] => [above]
[#teaser] => []
[#node] => stdClass (
)
[#type] => [content_field]
[#printed] => [1]
)
[#title] => []
[#description] => []
[#printed] => [1]
)
[disqus] => array (
[#weight] => [50]
[#value] => [<script type="text/javascript">var disqus_title = "CSS Font-Sizes";var disqus_message = "As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.";var disqus_developer = 1;</script><div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/webeasy/embed.js"></script><noscript><a href="http://webeasy.disqus.com/?url=ref">View the forum thread.</a></noscript>]
[#title] => []
[#description] => []
[#printed] => [1]
)
[#title] => []
[#description] => []
[#children] => [<div class="diggthis_button"><script type="text/javascript"><!--
digg_url = 'http://webeasymedia.com/blog/ryan/2010/02/css-font-sizes';
digg_title = 'CSS Font-Sizes';
digg_bodytext = "As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.";
digg_skin = 'standard';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="field field-type-filefield field-field-main-image">
<div class="field-items">
<div class="field-item odd">
<img src="http://webeasymedia.com/sites/webeasymedia.com/files/imagecache/article_image/css-tricks.jpg" alt="" title="" class="imagecache imagecache-article_image imagecache-default imagecache-article_image_default" width="275" height="119" /> </div>
</div>
</div>
<p>As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.</p>
<h3>The Units:</h3>
<ol>
<li><strong>“Ems” (em):</strong> The “em” is a scalable unit that is used in web document media. An em is equal to the current font-size, for instance, if the font-size of the document is 12pt, 1em is equal to 12pt. Ems are scalable in nature, so 2em would equal 24pt, .5em would equal 6pt, etc. Ems are becoming increasingly popular in web documents due to scalability and their mobile-device-friendly nature.</li>
<li><strong>Pixels (px):</strong> Pixels are fixed-size units that are used in screen media (i.e. to be read on the computer screen). One pixel is equal to one dot on the computer screen (the smallest division of your screen’s resolution). Many web designers use pixel units in web documents in order to produce a pixel-perfect representation of their site as it is rendered in the browser. One problem with the pixel unit is that it does not scale upward for visually-impaired readers or downward to fit mobile devices.</li>
<li><strong>Points (pt):</strong> Points are traditionally used in print media (anything that is to be printed on paper, etc.). One point is equal to 1/72 of an inch. Points are much like pixels, in that they are fixed-size units and cannot scale in size.</li>
<li><strong>Percent (%):</strong> The percent unit is much like the “em” unit, save for a few fundamental differences. First and foremost, the current font-size is equal to 100% (i.e. 12pt = 100%). While using the percent unit, your text remains fully scalable for mobile devices and for accessibility.</li>
</ol>
<h3>Why should I use one of these over another?</h3>
<p>It’s easy to understand the difference between font-size units when you see them in action. Generally, <strong>1em = 12pt = 16px = 100%</strong>. When using these font-sizes, let’s see what happens when you increase the base font size (using the body CSS selector) from 100% to 120%.</p>
<p><img alt="" height="116" width="480" src="/sites/webeasymedia.com/files/font-size.gif" /></p>
<p>In looking at the table above, it is apparent that both the em and percent units get larger as the base font-size increases, but pixels and points do not. Some people may argue that it is much easier to set an absolute size for your text using pixles(px) or points(pt), but you can acheive a much better experience for your visitors when using scalable text. Scalable text can be displayed appropriately on any device or any machine. This is especially useful now, as more and more of your end users may be viewing your content on a mobile device such as an iPhone or BlackBerry. For this reason, the em and percent units are preferred for web document text.</p>
<h3>It seems complicated to convert pixels (px) to ems (em). How can I make it easier?</h3>
<p>Normally you would use a conversion table to figure out what your <em>font-size</em> should be from pixels (px) to ems (em). Many people try to wing it or spend some time guessing numbers, but there is a much easier way. If the html body is set to 1em (browser standard: 1em = 16px), and the <em>font-size</em> you would want is 12px that would be 0.75em. e.g. 10px converts to 0.625em, 22px converts to 1.375em.</p>
<p>Now to make this easier:</p>
<p>You can set the <em>font-size</em> of the body to 62.5% (that is 62.5% of the browser default of 16px), which equates to 10px, or 0.625em. Now you can set your f<em>ont-size</em> in ems with an easy to remember conversion. All you need to do is divide the px value by 10 to get your em value.</p>
<ul>
<li>12px = 1.2em</li>
<li>13px = 1.3em</li>
<li>16px = 1.6em</li>
<li>8px = 0.8em</li>
<li>etc…</li>
</ul>
<p>This little trick makes your conversions very easy to remember and eliminates the need for conversion tables. There is one caveat though... you will still need to use a conversion table for nested elements when using ems, since the <code>font-size:</code> declaration in your css is relative to the element's parent. For example: a specification of <code>font-size:0.8em;</code> implies a font-size that is 0.8 times the <em>em size</em> of the parent element.</p>
<script type="text/javascript">var disqus_title = "CSS Font-Sizes";var disqus_message = "As a front-end web developer or designer, you may be confused about which unit to use when decalring font-sizes in your CSS. Here I will attempt to explain what each of the possible units means and why one is better than another.";var disqus_developer = 1;</script><div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/webeasy/embed.js"></script><noscript><a href="http://webeasy.disqus.com/?url=ref">View the forum thread.</a></noscript>]
[#printed] => [1]
)
[realname_save] => [ryan]
[realname] => [Ryan Ours]
[homepage] => []
[links] => array (
[blog_usernames_blog] => array (
[title] => [Ryan's Musings]
[href] => [blog/7]
[attributes] => array (
[title] => [Read Ryan Ours's latest blog entries.]
)
)
[addtoany] => array (
[title] => [
<a class="a2a_dd" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwebeasymedia.com%2Fblog%2Fryan%2F2010%2F02%2Fcss-font-sizes&linkname=CSS%20Font-Sizes"><img src="/sites/webeasymedia.com/modules/contrib/addtoany/images/share_save_171_16.png" width="171" height="16" alt="Share/Save"/></a>
]
[html] => [1]
)
)
);