<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Design That &#187; CSS</title>
	<atom:link href="http://www.design-that.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.design-that.com</link>
	<description>Making designers happy</description>
	<lastBuildDate>Sat, 21 Nov 2009 19:21:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Proper use of em in your CSS</title>
		<link>http://www.design-that.com/css/proper-use-of-em-in-your-css/</link>
		<comments>http://www.design-that.com/css/proper-use-of-em-in-your-css/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:14:26 +0000</pubDate>
		<dc:creator>Design That</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.design-that.com/?p=57</guid>
		<description><![CDATA[Many designers avoid using the em. You shouldn't be one of them, since using it correctly is easy and makes you a better designer. This article will help you cover the ground in 5 minutes or less.]]></description>
			<content:encoded><![CDATA[<h3><strong><span style="color: #333333;">What is the difference?</span></strong></h3>
<p>An em is a relative measurement and a pixel is a static measurement. What this means is that the actual size of an em is not always the same, while a pixel is always the same size.</p>
<h3><strong><span style="color: #333333;">Why use em?<br />
</span></strong></h3>
<p>One thing is accessibility but the other is the fact that it will <span style="text-decoration: underline;">speed up your design process</span>. If you use pixels and want to make all the fonts a bit bigger you have to change all the font sizes. However if you use em for font size, you can do this by changing the body font size and all the other font sizes will be resized accordingly.</p>
<h3><strong><span style="color: #333333;">When to use em and when to use pixels?</span></strong></h3>
<p>The best<em> </em>use for <span style="text-decoration: underline;">em</span> is <span style="text-decoration: underline;">when defining font size</span>. On the other hand it is much more practical to <span style="text-decoration: underline;">use pixels for defining the layout elements</span>.</p>
<h3><strong><span style="color: #333333;">Proper use of em</span></strong></h3>
<p>As I said before, the base for the size of em is in the definition of body.</p>
<p><em>example:</em></p>
<pre class="brush:css;">body{
font-size:12px
}</pre>
<p>Now the size of 1 em is 12 px.</p>
<p>The default browser value for em is 16px so by default if you want to get 12px you just enter 12/16=0.75em insted the 12px.</p>
<p>We can use this knowledge to set up our body font-size by entering</p>
<pre class="brush:css;">body{
font-size:0.75em
}</pre>
<p>Now we have set the size for 1 em and it&#8217;s 0.75em wich is the same as 12px.<br />
<strong></strong></p>
<p><strong>You&#8217;re all set to go! </strong>If you need help with px to em conversion just use this tool: <a title="px to em" href="http://pxtoem.com/#help" target="_blank">px to em</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.design-that.com/css/proper-use-of-em-in-your-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
